Windows service Setup project RRS feed

  • Question

  • Hi Guys

    I have created a windows service which is working fine. I used the installutil to install and uninstall the service and everything seems to be working in order.

    I then created a setup project  with some custom actions (to update some values in the app.config file) and built the project. The step worked fine as well and I could see whatever values I entered in the setup were updated in the app.config file and the service installed without any error. I ran the service and it looked fine.

    The only thing that is not working for me at the moment is the uninstall feature. When I tried uninstalling the service using the setup, it seemed to have finished successfully and removed all files from the folder but I could still see the service in the services console. I had to delete it using "sc DELETE servicename" command but I don't want to do that. I want the setup project to uninstall it automatically. If installutil can uninstall it, why isn't the setup project doing it? Is there something I need to add?

    Any help would be much appreciated.

    I am using Visual Studio 2019

    Monday, March 2, 2020 2:48 AM


All replies

  • Nevermind, I managed to find what was missing.

    I added primary output from windows service to all Custom Actions and now it automatically disappears from the services console

    Monday, March 2, 2020 3:54 AM
  • Hi,

    I'm glad to hear that the problem has been resolved.

    Please click "Mark as answer"of your own answer, so that it will help other members to find the solution quickly if they face a similar issue.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, March 2, 2020 5:56 AM