Joining AppInitialize Using WCF Service

I have problems with my WCF service. I need to inject the container for the pre application_start windsor and notice that I can use the AppInitialise method. It works on Visual Studio debug, but when I deploy to IIS, the code does not run. I initialized the class as follows

public static class Class1 { public static void AppInitialize() { IWindsorContainer container; container = new WindsorContainer("windsor.xml"); container.AddFacility<WcfFacility>(); container.Resolve<ProfileLookUpService>(); } } 

Is there any special task I need to do for this to work on IIS. I am using version 6.

Thanks!

+6
initialization wcf
source share
2 answers

Well, you need to know a few things:

  • a WCF service can be self-organized - it is not always hosted on IIS, so don't rely on an IIS-specific mechanism if it is ever possible

  • the server-side WCF service consists essentially of a ServiceHost (or user-defined child) that initializes the WCF runtime and creates the service class instances needed to process requests

So, it really depends on where you want to invest your things - my gut feeling tells me that you are probably interested in being able to create a custom descendant of ServiceHost and hook some of its methods and events to handle your initialization.

Check out some really good articles and a blog post on this topic:

+4
source share

If AppInitialize () is not called when the deployment server is launched on your server, most likely you did not enable WCF Non-Http activation on this server.

Go to Control Panel> Program and Features> Turn Windows features on or off, and then find Microsoft.NET Framework 3.5.1. In this parameter, make sure that the option to activate the Windows Communication Foundation HTTP connection is set.

-one
source share

All Articles