How to install Windows Service in C#??

Posted on 2009-12-18
Medium Priority
Last Modified: 2012-05-08
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...
Question by:gautam_reddyc
LVL 11

Expert Comment

ID: 26085108
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

LVL 15

Accepted Solution

angus_young_acdc earned 1500 total points
ID: 26104927
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.

Author Closing Comment

ID: 31667961

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question