Solved

Uninstall Windows service

Posted on 2004-09-17
4
2,725 Views
Last Modified: 2007-12-19
Hi!

I made a windows service in C#. I add an installer class and the windows service worked well.

I was installing and uninstalling my window service and every thing was good. Then I added a description in the installer class.

I ran installutil to uninstall my service, I thought that the service was uninstalled and replace my old .exe service for the new one.

When i tried to install again the service it showed me this error message:
 - The specified service has been marked for deletion.

And I could't install the service again .

The problem is that now,when I run installutil.exe /u it shows me this error message:
 -The savedState dictionary contains inconsistent data and might have been corrupted.

So I'm not able to install or uninstall the service.
There is a way to delete manually the service. Maybe editing the registry with regedit and/or deleting some files.

I'll thanks any help

Jorge

0
Comment
Question by:jorgearias
4 Comments
 
LVL 5

Expert Comment

by:tomasX2
ID: 12088957
have you tried a reboot?
setting the service on disabled before might help.
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12091071
you need to have the old service to uninstall it. without rebooting

Or you find it in regitry and delete the entry manually
http://www.codeproject.com/csharp/scheduler.asp?df=100&forumid=4150&exp=0&select=767085
0
 
LVL 4

Expert Comment

by:Farshid-Zaker
ID: 12091322
you can create a windows service using Visual C++ wizards. select ATL projects and then Service. You can edit service name in project resource files.
the generated service can be installed, and then uninstalled. so, the only thing you should to do is changing the name of the service to your corrupted service. then in command prompt, install and then uninstall the service. if there is any problem, ask me to provide you with detail steps.

FARSHID
0
 
LVL 15

Accepted Solution

by:
deepaknet earned 250 total points
ID: 12099945
Hi:

The message "The specified service has been marked for deletion." indicates on subsequent server reboot, the service will be removed.

You can also use sc.exe (or its GUI counterpart) to remove the service, which installutil.exe can not remove, if you miss the assembly on hand.

Deepak
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

680 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