简体   繁体   中英

Running windows service as a standalone application during DEBUG mode

I've a windows service that I need to install (installutil) every time I debug the application during development. Is there any way I can tweak the Installer/ProjectInstaller classes so that it runs as a console application during debug mode. Something like #if..#endif preprocessors can help?

Not sure if this helps, but when I write services I write the "worker" part of the service as a DLL and use it from a Winform/console app. I only use an actual service to call into the already tested and stable worker DLL.

I am a developer for an open source windows service hosting framework called Daemoniq. And debugging windows services as a console application 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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM