0
對不起,我的小問題打擾社區,但我只是卡住了!WCF服務連線自動配置問題
在我們進入細節之前,這裏是我的服務模塊的容器設置!
public class ServiceModule : Module
{
protected override void Load(ContainerBuilder builder)
{
base.Load(builder);
builder.Register(c => new ContextService(c.Resolve<IContextDataProvider>(),
c.ResolveNamed<IExceptionShield>("SRV_HOST_SHIELD"),
c.Resolve<IMonitoring>()))
.As<IContextService>();
builder.Register(c => new ExceptionShield(
c.ResolveNamed<IShieldConfiguration>("SRV_SHIELD_CONFIG")))
.Named<IExceptionShield>("SRV_HOST_SHIELD");
builder.Register(c => new ServiceExceptionShieldConfiguration()).Named<IShieldConfiguration>("SRV_SHIELD_CONFIG");
builder.RegisterType<ContextService>().Named<object>("Service.ContextService");
}
}
,我一直hawing的問題是,該服務的構造函數的第二個參數不能解決。
我已經嘗試了所有,對我來說,已知,排列包括只是簡單地初始化參數,沒有容器的分辨率。但所有目的都在同一個例外:
None of the constructors found with 'Public binding flags' on type 'Service.ContextService' can be invoked with the available services and parameters:
Cannot resolve parameter 'Common.ExceptionShield.IExceptionShield exceptionShield' of constructor 'Void .ctor(IContextDataProvider, Common.ExceptionShield.IExceptionShield, Common.Monitoring.IMonitoring)'.
我必須在這裏失去一些至關重要的東西。如果你看到我的錯誤,那麼請告訴我:)