You need to install your service for the Windows Service Control Manager (SCM) to know about it (by virtue of a resulting registry entry).
You have (at least) two options to do this:
sc create "SERVICENAME" binpath = "C:\whatever\Service.exe"
installutil "C:\whatever\Service.exe"
For sc create
, any command prompt should do. For installutil
, Visual Studio Command Prompt is the easiest way to run it - since the VS Command Prompt's PATH
environment variable makes using .NET command-line tools easy; and your service needs to implement a service (un)installer in my experience.
After you install and reality check your service, you will almost certainly want to uninstall it at some point - e.g. to then install a final version of it in a non-dev location or to just clean up dev service entries littering your list of installed services. You have corresponding options in sc delete
and installutil /u
- with the same caveats I explained above regarding installation options.
I have written more about some subtleties of uninstalling & installing Windows services that you might find interesting and/or helpful - particularly implementing a service (un)installer if you decide to take that route.