• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

How to install Windows Service in C#??

i have a windows service... i need to install it... Can anyone tell me the process to install it..

i read in some articles that we should install it with InstallUtil.exe..
can anyone tell me the procedure to install it.. Thank You...
1 Solution
InstallUtil is one way to do it. Depending on your .NET framework version you ll have to adjust the path and execute something like this:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe nameOfMyService.exe

to uninstall just add /u as a parameter.

Make sure that in your project you added an installer for your service. I would look at this great ressource from MS which also describes other ways to install your service (which in the end just calls installutil but is more "dev friendly"): http://msdn.microsoft.com/en-us/library/zt39148a.aspx

Click Start -> Visual Studio [Version] -> Visual Studio Tools then select Visual Studio [Version] Command Prompt, from here just type:

installutil.exe then the full path to your exe.  Eg:

installutil.exe "C:\MyApp\MyApp.exe"

That will install it.  Alternatively, you can create an MSI with a custom action to install your service, this would use the install class that you add in your project.
gautam_reddycAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now