Windows Service, uninstalling

  • Thread starter Thread starter Wayne
  • Start date Start date
W

Wayne

First if there is a better group to post this to please let me know.

Installutil Service.exe /u will uninstall a service. However, if I try to
reinstall the service without rebooting it error's out saying that the
service is marked for deletion. Is there a way to have windows complete the
service uninstall without rebooting?

--
Thanks
Wayne Sepega
Jacksonville, Fl


"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
 
I occasionally get that. Normally logging off is enough, or I have heard
removing the entry from the registry is also possible.

PS if you add an installer to the project you can simply right click to do
the install / uninstall from the IDE.

If there is a better answer, please feel free to post.
 
Do you have On Stop in your Service? In other words do you allow it to
stop?
 
I don't have anything in the event, and if I remember correctly the
allowstop is defaulted to true. Please let me know if I'm wrong.

Wayne
 
I believe the default is False for AllowStop, you might want to check your
windows service solution. I assume you avoid doing a little coding as
possible in the OnStart? Do you have a lot of code in your OnStop routine?
It sounds like your service is not able to stop in a timely manner and hence
why you get the "service is marked for deletion" error -- either holding on
to a resource that was not released or something (a datareader perhaps that
was not closed).

Do you have an OnShutDown defined? Are you "managed"? You may also want to
try forcing garbage collection.

In my initialize component I set

Me.CanPauseAndContinue = True
Me.CanShutdown = True
 
Back
Top