How to remove a service when installation is incomplete and the service is 'marked for deletion'

StackOverflow https://stackoverflow.com/questions/21113523

  •  28-09-2022
  •  | 
  •  

문제

Problem with developing and testing a service installer: result, the service is 'installed' and appears as such in the Services tool, but does not start and I cannot 'uninstall' it in the conventional way (files missing).

So I used the SC tool to delete the service. Now if I try to reinstall it, the installer reports that the service is 'marked for deletion'.

How can I recover from this?

TIA

도움이 되었습니까?

해결책

Restart machine and service status should be cleared. It is an old inconvenience I remember from .NET 2.0 and Windows XP times, that seems still not to be resolved.

다른 팁

It's nearly always an issue with some code somewhere on the system that has a handle open to the service and has leaked it. For example, the handle returned from the Win32 OpenService call, or somebody with a ServiceController class shutting it down and not doing a Close or Dispose. There used to be a bug in the services applet that caused this issue for this reason.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top