Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello All,

I have two different windows services for different purpose. I am able to run them as two separate windows services.

service1
service2

My requirement is like to run two different windows services with a single service name[Mainservice]. Instead of running two different services in services.msc I need to have a single service running under services.msc.

Please let me know your suggestions.

Thanks,
Chris.

What I have tried:

I have tried with two separate services.
Posted
Updated 3-Aug-18 2:01am
Comments
Richard MacCutchan 3-Aug-18 7:31am    
You would most likely need to combine them into one application with a controller that runs each part as a separate thread.

1 solution

The only way to do that would be to combine them into a single service application.

Like Richard said in his comment, you could run them independent of each other in separate threads.

But seriously, I'd split them into two services. If one service crashes or fails for some reason, you can stop just that service and leave the other one running.

If you combine them into a single service and one of your "sub services" crashes, you have to stop everything just to restart the one that failed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900