How to install Windows Service in C#??

Posted on 2009-12-18
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

    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"):

    LVL 15

    Accepted Solution

    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


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now