Gurjeet Singh

Gurjeet Singh

  • NA
  • 90
  • 95.1k

Install a c# windows service

Sep 22 2014 6:07 AM
How to install a c# windows service onto a machine that doesn't have Visual Studio installed?

Answers (1)

0
Pradeep Shet

Pradeep Shet

  • 336
  • 5.3k
  • 4.4m
Sep 22 2014 7:10 AM
Hi Michale,


It is simple, you only need framework installed. Visual Studio is not required..
If suppose it is framework 4.0 then 
1)Open cmd prompt
2) move to below directory
cd C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 
3) Then use installutil -i "windows service exe path"
4) Thats it

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>installutil -i "c:\ABC.exe"

To uninstall the service, 
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>installutil -u "ServiceName"

To Delete service 
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>sc delete "servicename"

Note : Service name is you name of service which you can get it from services
Run> type services.msc

Hope this helps you. Mark it answered if so.