2

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

Peter Zajic
  • 899
  • 8
  • 17
  • How about putting your solution as an answer and marking it as such? That way the question will not remain on the unanswered list. – kmp Mar 06 '12 at 13:09
  • That would be very useful as I am also trying to solve this problem. – Remotec Mar 29 '12 at 13:36

1 Answers1

0

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.

Peter Zajic
  • 899
  • 8
  • 17