如何使用最新的温莎城堡WCF集成工具
我正在使用 Castle WCF 集成工具,因为我想将我的 WCF 服务与温莎 IOC 集成。
我面临的问题是我无法为 DefaultServiceHostFactory 设置 IKernel。
我设置容器:
container = new WindsorContainer().AddFacility<WcfFacility>();
container.Register(Component.For<DefaultServiceHostFactory>());
container.Register(Component.For<IFoo>().ImplementedBy<Foo>());
然后设置 SVC 文件:
<%@ ServiceHost
Language="C#"
Debug="true"
Service="Foo"
Factory="Castle.Facilities.WcfIntegration.DefaultServiceHostFactory, Castle.Facilities.WcfIntegration"%>
当 WCF 尝试实例化 DefaultServiceHostFactory 时,它表示 kernell 为 null 并建议使用 DefaultServiceHostFactory.RegisterContainer(IKernel kernel) 方法。但是,此方法在最新版本的 WCF 工具中不可用。
任何帮助估价!
谢谢
I'm playing around with Castle WCF integration facility because I want to integrate my WCF services with windsor IOC.
The issue I'm facing is that I can't set IKernel for DefaultServiceHostFactory.
I setup the container:
container = new WindsorContainer().AddFacility<WcfFacility>();
container.Register(Component.For<DefaultServiceHostFactory>());
container.Register(Component.For<IFoo>().ImplementedBy<Foo>());
Then I setup the SVC file:
<%@ ServiceHost
Language="C#"
Debug="true"
Service="Foo"
Factory="Castle.Facilities.WcfIntegration.DefaultServiceHostFactory, Castle.Facilities.WcfIntegration"%>
When WCF tries to instantiate DefaultServiceHostFactory it says kernell is null and recommends using DefaultServiceHostFactory.RegisterContainer(IKernel kernel) method. However this method is not available in latest version of WCF facility.
Any help appriceated!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现,我正在将应用程序部署到 Windows Azure,并且使用 Web 角色启动来进行容器注册(错误!),一旦我将容器设置放入 Global.asax 文件中,它也开始适用于 IIS 和 Azure 模拟器。
figured it out, I was deploying the application to windows Azure and I used the web role startup for container registration (WRONG!) once I putted the container setup into Global.asax file it started working for IIS and Azure emulator as well.