Debugging .NET-based Windows Services

We haven’t needed to implement a Windows Service in a while, but certainly have experienced the pain of debugging them when run by Service Control Manager (SCM).  Here are a couple of links to good tools and discussion on the topic:

Run Windows Service as a Console Program by Einar Egilsson provides a good example of how to debug your service easily as a console app.  It also includes some good discussion of single- and multi-service hosting services, various ways to end or break out of the service process when running as console app, etc.

Windows Service Helper on CodePlex is a SCM replacement which provides for F5 debugging from Visual Studio. The UI it provides gives you the SCM-esque start, stop, pause capabilities to facilitate debugging the associated functionality in your service.

Hopefully these may be useful to you, but if nothing else, this will be a good reminder for the next time we do a Windows Service.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.