I get the error “Cannot start service from the command line or a debugger. A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.
So, is there not a way to run or test the Windows Service without installing it? Should I build my project in a Console Application, then transfer the code to a Windows Server project after it has been tested?
Thanks.
I tend to add a static Main method to my service class so that it can be invoked as a console application for debugging, but installed and ran as a service as well.
Something similar to the following: