Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jetstreamin/86c08ce7af4e3753f4d5 to your computer and use it in GitHub Desktop.
Save jetstreamin/86c08ce7af4e3753f4d5 to your computer and use it in GitHub Desktop.
Source: http://stackoverflow.com/questions/11573724/windows-service-start-failure-cannot-start-service-from-the-command-line-or-deb
Your code has nothing to do with the service installation, it is not the problem.
In order to test the service, you must install it as indicated.
For more information about installing your service : Installing and Uninstalling Services
--------------------------------------------
To install your service manually
To install or uninstall windows service manually (which was created using .NET Framework) use utility InstallUtil.exe. This tool can be found in the following path (use appropriate framework version number).
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe
To install
installutil yourproject.exe
To uninstall
installutil /u yourproject.exe
See: How to: Install and Uninstall Services (msdn)
Install service programmatically
To install service programmatically using C# see the following class ServiceInstaller (c-sharpcorner).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment