29 Ekim 2013 Salı

Install / Uninstall .NET Windows Service [C#]

Sponsorlu Bağlantılar
This example shows 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 "c:\myservice.exe"

To uninstall .NET service use the same command with parameter /u.
InstallUtil.exe /u "c:\myservice.exe"

Install service programmatically

To install service programmatically using C# see the following class ServiceInstaller in c-sharpcorner.com article.

Sponsorlu Bağlantılar

Hiç yorum yok:

Yorum Gönder