Startup Code for Loading COM Object for WCF Service -
I currently have a WCF service that uses a COM DLL for its service. The COM object is loaded only once and is saved by singleton. The problem is that for the first time the COM object is loaded for 19 minutes. The WCF service is hosted through a Windows service, I am thinking how can I load a COM object singleton through the startup of the Windows object.
Protected Override Zero Ostart (String [] ARG) {if (host! = Null) {host.Close (); } Type service type = MyService; Host = new service host (service type); Host.Open (); ObjectConn.getInstance ()}
When I try to add a singleton load to the onset of Windows Service Startup, it always fails. I would like to ask if I am the proper way to add the startup routine for the object. For example, I tried to install singleton loading in the Mement service, but it is called only with the first call for web service operation / method , Which makes me call the first service call weird.
I read about dependencies, but I think the added behavior is not applicable because I just want to load the COM object source once.
You might do this - but I
host Open call This call runs the entire WCF runtime and everything above, and I like to do all the initial tasks before it, if ever possible. Mark
Comments
Post a Comment