.NET Windows Service - multiple services in one project

Viewed 24477

Currently, I have a project with a Windows Service. I also created another "Setup Project" which installs the Windows Service.

My question is this: Can I add another Windows Service to the same project? (This way, I can use 1 installer, and share some code between the services more easily.) If I can, does that mean when one service encounters errors then both services are stopped, or do they error out independently of each other?

Are there any other differences between coding 1 service per project, or having multiple services in one project?

3 Answers

I am a developer for an open source windows service hosting framework called Daemoniq. Running multiple services in one process is one of its features. You can download it from http://daemoniq.org

Current features include:

  • container agnostic service location via the CommonServiceLocator
  • set common service properties like serviceName, displayName, description and serviceStartMode via app.config
  • run multiple windows services on the same process
  • set recovery options via app.config
  • set services depended on via app.config
  • set service process credentials via command-line
  • install, uninstall, debug services via command-line

Thanks!

Related