A while ago I blogged about a template project that I often use as my starting point for Windows services. I’ve recently been introduced to a component called TopShelf that makes writing a service even simpler as well as taking just about all the plumbing code needed for installing/uninstalling and running in debug mode. Here’s an example of the code that goes into the Main method. It sets up the service, name, description, and you tell it what to call on the Start and Stop service control events. static void Main(string[] args)
...