2

因爲我想將我的WCF服務與Windsor IOC集成,所以我在玩城堡WCF集成設施。如何使用最新的城堡windsor wcf集成設施

我面臨的問題是我無法爲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內核) 方法。但是,此方法在最新版本的WCF工具中不可用。

任何幫助appriceated!

感謝

+0

將您的解決方案作爲答案並將其標記爲如何如何?這樣的問題不會留在未答覆的清單上。 – kmp

+0

這將是非常有用的,因爲我也試圖解決這個問題。 – Remotec

回答

0

想通了,我是將應用程序部署到Windows Azure,我使用的Web角色啓動集裝箱註冊(錯誤!),一旦我的推杆容器安裝到Global.asax文件就開始爲工作IIS和Azure模擬器。