views:

49

answers:

2

I have five Windows services that all exist in the same exe. Is there a way to tell Windows to run each service as it's own process?

A: 

Couldn't you use background worker threads?

Jeff
Well yea, pretty much all services run that way. My goal is to increase the isolation level so a failure in one doesn't bring the others down.
Jonathan Allen
+1  A: 

Yes. See the CreateService API

Note the SERVICE_WIN32_OWN_PROCESS flag.

Christopher
It appears you are right, but I dread the idea of ripping out my installer logic (.NET based) and switching to p/invoke calls. Oh well, there are other things I don't like about the .NET service installer anyways, so maybe this is the right time to fix all of that.
Jonathan Allen
I empathize. I wonder if you put each service in it's own IServiceContainer, tell each service config to be a different name, and then run svcutil for each piece separately what happens.
Christopher