Installing/Uninstalling Services in Windows 7: "Error 1001. The specified service has been marked for deletion"

Mas picture Mas · Nov 22, 2010 · Viewed 28.5k times · Source

I am currently developing a Windows Service in .NET 4.0, Visual Studio 2010, Windows 7-32bit. I have an installer project that does the installation for me. When I install the service, uninstall it, and try to install again, I get the following error:

Error 1001. The specified service has been marked for deletion

In Windows XP, the problem was that the Services.msc was open. Closing this window would fix this problem.

However, with Windows 7, the only way I can fix this is to restart. I tried closing all my programs, but the problem still persists.

Does anyone know how to fix this without restarting?

Edit

I have not seen this problem since I stopped using the MSI installer, I use sc.exe instead, to install the services manually. I think this problem might be related to the combination of Visual Studio 2010 and MSI Installer Projects. However, I still don't know what was the culprit of this problem. It turns out that Process Explorer was the culprit.

Answer

Ramya picture Ramya · Dec 16, 2011

I was facing the same problem on Windows 7 Ultimate edition. Installing the service after closing the Services.msc window solved my problem.