Answered by:
Windows service not showing up in service manager

Question
-
I wrote a WindowsService application using C# on .NET 3.5, there I used a project installer and set up program to package the application.
When I installed this, it worked well, succefullyt installed and event viewer says it success. When I goto add/remove Programs on the contro pannel there it shows the applicaiton to remove.
BUT, this is not showing up in the Service Manager.. Can someone please help me to fix this?
NOTE: I have tested this applicaion through a test clinent application (Windows Forms app) and there I didn't find any issues.
ThxTuesday, November 3, 2009 9:02 AM
Answers
-
Try to install the service manually by running InstallUtil.exe:
%windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe [YourSvc.exe]
If this succeeds, than you have a problem with your setup project that needs to be investigated. If the command fails use the logging switches of InstallUtil to get more information.- Marked as answer by NSJ SL Tuesday, November 3, 2009 10:08 AM
Tuesday, November 3, 2009 9:34 AM
All replies
-
Try to install the service manually by running InstallUtil.exe:
%windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe [YourSvc.exe]
If this succeeds, than you have a problem with your setup project that needs to be investigated. If the command fails use the logging switches of InstallUtil to get more information.- Marked as answer by NSJ SL Tuesday, November 3, 2009 10:08 AM
Tuesday, November 3, 2009 9:34 AM -
Thx Marcel,
IstallUtill was able to add the service to the service manager...
Noe I'm loking at the installer project to isloate the issue.
Appreciate your advice...Tuesday, November 3, 2009 10:08 AM -
Ok, so what was the root cause? Win Services drive me batty everytime. I too have ran installutil.exe and successfully installed the service but when running my setup project with the service as the Primary Output, no go.
Have you found the cause?- Proposed as answer by Ruge Monday, January 25, 2010 11:56 PM
Monday, January 25, 2010 9:43 PM -
After a couple hours of research, here's what I've found and I am sure this is a bug in VS2008 (since there's like 500 bugs related to Windows Services anyway).
Just to be clear, the symptoms are: 1) from the command prompt, InstallUtil YourService.exe installs the service and it shows up properly in the Services MMC Snap-In. 2) a setup project with the Primary Output set to your service project and it does NOT show up in the Services Snap-In.
Check that your setup project contains these four Custom Actions. If you right click the setup project, open the View | Custom Actions menu item. You should see Primary output from YourService under all four of the Custom Actions: Install, Commit, Rollback, and Uninstall.
Are these supposed to get done automatically when you add the service project as the Primary Output? If anyone knows for sure, PLEASE post something here.
If those four actions don't have the Primary output..., then you can manually add those to each of the Custom Actions nodes. In the Custom Action viewer, r-click each of the nodes, click Add Custom Action..., select Look in: Application Folder, then select the Primary output from... your service.
This was super frustrating so hopefully this will help someone out. Again, please post any corrections to this analysis.- Proposed as answer by Not able to view Upload document functionality TFS Monday, June 7, 2010 7:16 PM
- Edited by Ruge Monday, August 9, 2010 3:02 AM Clarified post by switching two paragraphs.
Tuesday, January 26, 2010 12:25 AM -
Thanks for posting such useful information, it solved my problem.
- Proposed as answer by PiyushSinghi Thursday, August 5, 2010 3:29 PM
Monday, June 7, 2010 7:20 PM -
Check that your setup project contains these four Custom Actions . If you right click the setup project, open the View | Custom Actions menu item. You should see Primary output from YourService under all four of the Custom Actions : Install, Commit, Rollback, and Uninstall .
- Proposed as answer by kumark08 Thursday, July 15, 2010 4:17 PM
Friday, June 11, 2010 9:20 PM -
many many thanks.it was like fruuuuuuuuuuuuuuuuuuuuuuuuuutating for me ....Thursday, July 15, 2010 4:18 PM
-
Thanks a lot Ruge...I was facing the same problem since days..Thursday, August 5, 2010 3:29 PM
-
Thx Ruge for your valuable finding, highly appreciated itFriday, September 10, 2010 5:19 AM
-
Thanks! It worked !!Thursday, October 7, 2010 5:18 PM
-
yikes... It was the same issue in VS2010... took me more than an hour... until I saw this post... why Microsoft didn't fix this in VS2008?Thursday, October 7, 2010 10:11 PM
-
Hi Ruge,
Are these supposed to get done automatically when you add the service project as the Primary Output? If anyone knows for sure, PLEASE post something here.
The custom actions are *not* added automatically by Visual Studio. You'll have to add them manually as decribed in the MSDN documentation. Please refer to the topic "To create the installers for your service":
Visual Studio 2008 > Walkthrough: Creating a Windows Service Application in the Component Designer:
http://msdn.microsoft.com/en-us/library/zt39148a(v=VS.90).aspx
Visual Studio 2010 > Walkthrough: Creating a Windows Service Application in the Component Designer:
http://msdn.microsoft.com/en-us/library/zt39148a(v=VS.100).aspxMarcel
Friday, October 15, 2010 9:23 AM -
Hi, Ruge!
Originally I had the same problem with my Windows Service not being listed under Services. Then I read your reply to this question (Windows service not showing up in service manager). I followed the instructions therein, rebuilt the setup project and executed the MSI. The install failed... something about a missing InstallState file. The install was automatically backed out. Then I rebuilt the setup project and executed the MSI again. The install failed again... this time Error 1001. The specified service already exists. I can't uninstall because the install failed. How do I remove this service?
Friday, February 4, 2011 4:32 PM -
Hi, Ruge!
I found out how to remove a Windows Service. Simply type sc delete <Windows Service> at the command prompt.
I tried to install the Windows Service again... I got the original error message: Error 1001. Could not find the file '<Application Folder>\<Windows Service>.InstallState' (twice).
How is this InstallState file created?
Friday, February 4, 2011 5:18 PM -
Hmmmm, have not dealt with InstallState. Sorry, doesn't ring a bell for me.
Be aware of the full Windows Service development lifecycle in Visual Studio. See Marcel's suggested links:
Visual Studio 2008 > Walkthrough: Creating a Windows Service Application in the Component Designer:
http://msdn.microsoft.com/en-us/library/zt39148a(v=VS.90).aspx
Visual Studio 2010 > Walkthrough: Creating a Windows Service Application in the Component Designer:
http://msdn.microsoft.com/en-us/library/zt39148a(v=VS.100).aspxYou should eventually be able to simply right-click the setup project within the solution and select Install and Uninstall from within VS's Solution Explorer.
Wednesday, February 16, 2011 2:59 PM -
Hi Ruge,
Thanking You for help. now its work......... wowwwwwwwwwwwwwwwwwwwwwwww
Wednesday, October 5, 2011 10:23 AM -
Try to install the service manually by running InstallUtil.exe:
%windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe [YourSvc.exe]
If this succeeds, than you have a problem with your setup project that needs to be investigated. If the command fails use the logging switches of InstallUtil to get more information.Hey,
I have try below formula but can't success..
%windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe [YourSvc.exe]
What should I do now.
let me know your thoughts.
Thanks,
siddheshwardulchal@zed.com
- Edited by Siddheshwar Duchal Wednesday, October 12, 2011 10:50 AM
Wednesday, October 12, 2011 10:46 AM -
IMHO, I believe this is Microsoft's way of "fixing" a defect without fixing the defect. ;-)Wednesday, October 12, 2011 2:37 PM
-
IMHO, I believe this is Microsoft's way of "fixing" a defect without fixing the defect. ;-)
Really Useful Ruge!!
Thanks From Vilas Mahalle
- Proposed as answer by Vilas Mahalle Friday, December 23, 2011 7:33 AM
Friday, December 23, 2011 7:30 AM -
Thanks so much for this help....It really helped me :)Wednesday, January 18, 2012 6:52 PM
-
You can use MSIZAP T <test.msi> and it will remove all registry entries etc for you. You can read more here:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa370523(v=vs.85).aspx It is installed by default on windows7 run as admin g'luck
Friday, February 3, 2012 4:22 PM -
Hi turttleZipper,
You are apparently replying to a posting that is about one year old.
(So, please, don't be disappointed if the O.P. doesn't get back to you.)
Just as a side note: Msizap.exe and Msicuu2.exe are no longer supported by Microsoft.
You now can use the program install and uninstall troubleshooter available here:
http://support.microsoft.com/mats/program_install_and_uninstall/en-us
MarcelFriday, February 3, 2012 5:31 PM -
Thanks...just a newbie so forgive me please ;-)Friday, February 3, 2012 5:48 PM
-
No problem.Friday, February 3, 2012 8:41 PM
-
Thanks!!! That helped. I have been trying to figure this out for a couple hours!!!Sunday, October 7, 2012 2:07 AM
-
Thank For your post ... It is really good information .
Santosh Jha
Wednesday, November 20, 2013 5:37 AM