Sunday, 16 February 2020

C# - Window Service (Install and Uninstall/Delete)

Install your service manually using InstallUtil.exe utility

  1. From the Start menu, select the Visual Studio <version> directory, then select Developer Command Prompt for VS <version>.
Run InstallUtil.exe from the command prompt with your project's executable as a parameter:

installutil <yourproject>.exe


Run InstallUtil.exe from the command prompt with your project's output as a parameter:


Uninstall your service manually using InstallUtil.exe utility

  1. From the Start menu, select the Visual Studio <version> directory, then select Developer Command Prompt for VS <version>.
installutil /u <yourproject>.exe

After the executable for a service is deleted, the service might still be present in the registry. If that's the case, use the command sc delete to remove the entry for the service from the registry.

C:\Windows\system32>sc delete ConfigReader.exe








No comments:

Post a Comment