Register WCF Windsor container

My goal is to register a Windsor container for my service other than http WCF. However, I cannot figure out where to put the code for registering and initializing the container.

I tried to put ...

Factory="Castle.Facilities.WcfIntegration.DefaultServiceHostFactory, Castle.Facilities.WcfIntegration"

... to my ServiceHost declaration in my .svc file, however this does not trigger the Application_Start () method in my Global.asax.cs.

I also tried to put a static method inside the class as follows:

public static void AppInitialize()
{
}

... however, this method also does not work.

Method obtained from Castle Windsor, ...

The kernel was null, did you forget to call DefaultServiceHostFactory.RegisterContainer ()?

I could really do an example with code that shows exactly where to register the container. Also, where should I dispose of the container.

Thank.

+2
3

AppInitialize. -, , Castle.Facilities.WcfIntegration.WcfFacility:

container.AddFacility<Castle.Facilities.WcfIntegration.WcfFacility>();

, , .

+1

?

-

static MyClass()
{
  // setup windsor
  WindsorContainer windsorContainer = new WindsorContainer();
  ..

}

- , StructureMap - , Windsor....

http://lostechies.com/jimmybogard/2008/07/30/integrating-structuremap-with-wcf/

0

, , , .

  • Global.asax Global.asax.cs? Global.asax codebehind?
  • void Application_Start ( , EventArgs e)?
  • Application_Start(), Castle Windsor?

Global.asax , . , .asax

<%@ Application Codebehind="Global.asax.cs" Inherits="YourNamespace.Global" Language="C#" %>

.

( , . .)

0

All Articles