Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用最新的castle windsor wcf集成设施_Wcf_Inversion Of Control_Castle Windsor_Ioc Container_Castle - Fatal编程技术网

如何使用最新的castle windsor wcf集成设施

如何使用最新的castle windsor wcf集成设施,wcf,inversion-of-control,castle-windsor,ioc-container,castle,Wcf,Inversion Of Control,Castle Windsor,Ioc Container,Castle,我正在使用Castle WCF集成设施,因为我想将我的WCF服务与温莎国际奥委会集成 我面临的问题是无法将IKernel设置为DefaultServiceHostFactory 我设置容器: container = new WindsorContainer().AddFacility<WcfFacility>(); container.Register(Component.For<DefaultServiceHostFactory>());

我正在使用Castle WCF集成设施,因为我想将我的WCF服务与温莎国际奥委会集成

我面临的问题是无法将IKernel设置为DefaultServiceHostFactory

我设置容器:

container = new WindsorContainer().AddFacility<WcfFacility>();
        container.Register(Component.For<DefaultServiceHostFactory>());
        container.Register(Component.For<IFoo>().ImplementedBy<Foo>());
container=new WindsorContainer().AddFacility();
container.Register(Component.For());
container.Register(Component.For().ImplementedBy());
然后我设置SVC文件:

<%@ ServiceHost 
Language="C#" 
Debug="true" 
Service="Foo" 
Factory="Castle.Facilities.WcfIntegration.DefaultServiceHostFactory, Castle.Facilities.WcfIntegration"%>

当WCF尝试实例化DefaultServiceHostFactory时,它表示kernell为null,并建议使用DefaultServiceHostFactory.RegisterContainer(IKernel内核)方法。但是,此方法在最新版本的WCF设施中不可用

任何帮助通知


谢谢你,我当时正在将应用程序部署到windows Azure,我使用web角色启动进行容器注册(错误!)一旦我将容器设置放入Global.asax文件中,它就开始在IIS和Azure emulator上工作了。

我找到了答案,我正在将应用程序部署到windows Azure,并使用web角色启动进行容器注册(错误!)一旦我将容器设置放入Global.asax文件,它也开始在IIS和Azure emulator上工作。

将解决方案作为答案并将其标记为答案如何?这样,问题就不会保留在未回答的列表上。这将非常有用,因为我也在尝试解决这个问题。将您的解决方案作为答案并标记为答案如何?这样的话,这个问题就不会留在没有答案的名单上了。这将是非常有用的,因为我也在努力解决这个问题。