Geeks With Blogs

News
Steve Clements .Net and then some....

System.ComponentModel.Win32Exception: The specified service has been marked for deletion.

This is the first time I have ever seen this error and it may well have been complete luck that I haven't as there seems to be a pretty solid reason why it occurs.

It popped when I uninstalled a service using InstallUtil.exe, then tried to install again using the same utility.  Because I had the Windows Services window open (apparently it can also happen when you run uninstall without stopping the service as well, but seriously, who would be so reckless! ;-) ) when executing the uninstall there are some registry keys that are not deleted so when you try an install again the error occurs.

The simple solution was to close the windows services window and run uninstall/install again...Bingo!

 

Posted on Sunday, April 27, 2008 7:09 PM .NET 3.5 , .NET | Back to top


Comments on this post: Gotcha | Windows Service reinstall

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
Thanks, fixed my problem!
Left by Paul on Jun 15, 2009 4:06 PM

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
Fixed mine, too! Thanks!
Left by Robert on Oct 28, 2009 1:04 PM

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
Hi, thanks! Fixed mine as well.
Left by Joanne on Nov 18, 2009 1:29 PM

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
All right. So apparent, yet so mysterious! Just keep the windows service window closed when installing/uninstalling. Go figure.

Thanks!
Left by granadaCoder on Jan 13, 2010 5:35 AM

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
Thanks a lot..Fixed my problem...
Left by Sankar on Jan 20, 2010 6:51 PM

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
I'm having the same issue but having the services window doesn't appear to have any effect in Windows XP SP3.

However, deleting a service from the following key has helped me in the past:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
Left by headboards on Jan 21, 2010 8:45 PM

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
Thank you very much! Helped me clear my hurdle in Windows Server 2003!
Left by Matt on Mar 22, 2011 4:20 AM

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
Holly shit, it was only that? thanks a lot
Left by Daniel on Mar 24, 2011 4:21 AM

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
O!!!!!! M!!!!!!! G!!!!!!!!!!!! Finally, after years of searching it's Sys Internals Process Explorer!!! This has been driving me nuts, hate having to logoff/reboot. Thank you, thank you, thank you!!! Where do I send the check for 1000s???
Left by David on Aug 09, 2011 6:25 AM

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
Thanks! I've had reinstalled services many times with the Windows Services window open and never had that problem before...
Left by Mike on Oct 21, 2011 1:55 AM

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
Thanks for that tip; best part of this, no need to reboot even if the problem had already occurred... simply rerun your installer and you're good to go!
Left by Jason Nadal on Nov 08, 2011 1:41 AM

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
Thanks.. Solved mine too :-)))
Left by Priya on Jan 12, 2012 11:01 AM

# re: Gotcha | Windows Service reinstall
Requesting Gravatar...
Thanks, solved!!
Left by josh on Feb 15, 2012 10:58 PM

Your comment:
 (will show your gravatar)


Copyright © Steve Clements | Powered by: GeeksWithBlogs.net