Often, when I develop services I want to run them interactively from the command line. For example, for testing running under different user accounts with different privileges and for debugging purposes. After having written a few of these services by hand in a variety of languages I have finally had time to create a Visual Studio template for a ‘Console Service Application’. It is basically a modified version of the existing service template (with the implementation in a single class) with console properties enabled. In addition, there are a few lines of plumbing code to fork to the appropriate mode.
Simply drop the ConsoleService.zip file into <your documents directory>\Visual Studio 2008\Templates\ProjectTemplates\Visual C#.