IntroductionThis article shows how to install or uninstall a .NET Windows Service using C#. This article starts with an introduction of installing and uninstalling a .NET Windows Service using C#.To install or uninstall Windows Service (that was created using the .NET Framework) use the utility InstallUtil.exe. This tool can be found in the following path.Step 1Open a Command Prompt window.Open InstallUtil.exe in the directory for Framework 2.0; the path is “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\”.Figure 1Step 2Then .NET service runs as a command similar to this (specify the full path to your service):“InstallUtil.exe C:\DemoService\DemoWindowsService.exe”Figure 2Step 3And if you want to uninstall a Windows Service then you just add ‘/u’ between installutil.exe and the path as in the following:“InstallUtil.exe /u C:\DemoService\DemoWindowsService.exe”Figure 3Final StepFor doing a service check after installing you just open to the local services and find your service as in the following:Figure 4SummaryIn this article, I explained how to install or uninstall a .NET Windows Service using C# using InstallUtil.exe.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: