使用WCF工具解析WCF服务时出错
本文关键字:WCF 出错 服务 工具 使用 | 更新日期: 2023-09-27 18:15:19
我一直得到以下错误:
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")));
}
我的系统。服务模型部分。配置如下:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<client>
<endpoint address="http://****.com/SonatribeCommandService.svc" binding="basicHttpBinding" contract="CommandService.ISonatribeCommandService" name="commandServiceClient"></endpoint>
</client>
</system.serviceModel>
当使用add web reference方法时,服务工作正常。
更新:我也尝试过配置方法:
<configuration>
<components>
<component
id="commandService"
type="CommandService.SonatribeCommandService, CommandService"
wcfEndpointConfiguration="commandServiceClient" />
</components>
</configuration>
任何想法?
看起来你使用的是不兼容的Windsor和设备版本。请确保您使用的WCF Facility版本应该与您现有的Windsor版本配套使用。