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: no parameterless constructor defined for this object.
プロパティ注入も試しましたが、依存関係は常に null です。