How to install or uninstall .net windows service - C#


In the previous article, create windows service  we learnt creation of windows service using .net (C#). Now we will continue with how to install and uninstall a .NET windows service.

Install service using InstallUtil.exe
To install or uninstall windows service (which was created using .NET Framework) use utilityInstallUtil.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 .NET service run command similar to this (specify full path to your service).

InstallUtil.exe "D:\Examples\MyService\MyService\bin\Debug\myservice.exe"

To uninstall .NET service use the same command with parameter /u

InstallUtil.exe /u "D:\Examples\MyService\MyService\bin\Debug\myservice.exe"

That's all now we are done with installation/un-installation of windows service.

Comments

Popular posts from this blog

Auto Scroll in Common Controls

Convert typed library (.tlb) to .net assembly?

Disable close button on form - C#