Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Web services 在asmx Web服务中集成Ninject_Web Services_Visual Studio_Ninject - Fatal编程技术网

Web services 在asmx Web服务中集成Ninject

Web services 在asmx Web服务中集成Ninject,web-services,visual-studio,ninject,Web Services,Visual Studio,Ninject,在Soap Web服务中集成Ninject的最佳方式是什么 我试过使用NuGet和Ninject.Wcf包。但是,当我尝试使用没有无参数构造函数的asmx服务时,会出现一个错误 服务看起来像: public class Authentication : System.Web.Services.WebService { private readonly IDosReactingAuthentication dosReactingAuthentication; public Aut

在Soap Web服务中集成Ninject的最佳方式是什么

我试过使用NuGet和Ninject.Wcf包。但是,当我尝试使用没有无参数构造函数的asmx服务时,会出现一个错误

服务看起来像:

public class Authentication : System.Web.Services.WebService
{
    private readonly IDosReactingAuthentication dosReactingAuthentication;

    public Authentication(IDosReactingAuthentication dosReactingAuthentication)
    {
        this.dosReactingAuthentication = dosReactingAuthentication;
    }

    [WebMethod]
    public bool Auth(string domain, string username, string password)
    {
        return dosReactingAuthentication.Auth(domain, username, password);
    }
}
当我使用
Auth()
服务时,我总是得到
System.MissingMethodException:没有为此对象定义无参数构造函数。


我也尝试了属性注入,但依赖项始终等于null。

错误是什么?您尝试了什么(显示一些代码)@christiandev我安装了NuGet/Ninject.Wcf包。我提供了在应用程序启动时正确配置的绑定。当我运行服务并尝试使用它时,我得到System.Web.Services.Protocols.SoapException-->System.MissingMethodException:没有为此对象定义无参数构造函数。