我不断收到以下错误:
Method not found: 'Void Castle.MicroKernel.ComponentActivator.ComponentActivatorException..ctor
这来自 global.asax 中的以下初始化代码:
private void ConfigureContainer()
{
_container = new WindsorContainer();
_container.Register(Component.For<IWindsorContainer>().Instance(_container))
.AddFacility<WcfFacility>()
.Register(Component.For<ISonatribeCommandService>()
.AsWcfClient(DefaultClientModel
.On(WcfEndpoint.FromConfiguration("commandServiceClient")))
.LifestyleTransient())
.Install(FromAssembly.InDirectory(new AssemblyFilter(HttpRuntime.BinDirectory, "Sonatribe*.dll")));
}
我在 web.config 中的 system.servicemodel 部分如下所示:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<client>
<endpoint address="http://****.com/SonatribeCommandService.svc" binding="basicHttpBinding" contract="CommandService.ISonatribeCommandService" name="commandServiceClient"></endpoint>
</client>
</system.serviceModel>
该服务在使用添加 Web 参考方法时工作正常。
更新:
我也尝试过配置方法:
<configuration>
<components>
<component
id="commandService"
type="CommandService.SonatribeCommandService, CommandService"
wcfEndpointConfiguration="commandServiceClient" />
</components>
</configuration>
有任何想法吗?