使用 WCF 工具解决 WCF 服务时出错
我不断收到以下错误:
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>
有什么想法吗?
I keep getting the following error:
Method not found: 'Void Castle.MicroKernel.ComponentActivator.ComponentActivatorException..ctor
this is from the following initialization code in 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")));
}
my system.servicemodel section in web.config looks like:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<client>
<endpoint address="http://****.com/SonatribeCommandService.svc" binding="basicHttpBinding" contract="CommandService.ISonatribeCommandService" name="commandServiceClient"></endpoint>
</client>
</system.serviceModel>
The service works fine when using the add web reference method.
UPDATE:
I also tried doing the config method too:
<configuration>
<components>
<component
id="commandService"
type="CommandService.SonatribeCommandService, CommandService"
wcfEndpointConfiguration="commandServiceClient" />
</components>
</configuration>
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您正在使用不兼容的 Windsor 版本和该设施。确保您使用的 WCF 工具版本适合与您拥有的 Windsor 版本一起使用。
It looks like you're using incompatible versions of Windsor and the facility. Make sure you're using version of WCF Facility that was meant to be used with the version of Windsor you have.