How do I programmatically prevent a service from stopping? I want to
be able to keep my service running (started), under certain conditions,
when a user tries to stop it. I have tried throwing an exception
- from OnStop(): the SCM waits for a long time, reports that the
service didn't respond in a timely fashion and then leaves the status
as stopping.
- from Dispose(): the SCM displays an error dialog with the exception
details and prompts me to select a debugger. If I select 'No' the
service is stopped.
..NET Framework 1.1
MSDE 2003
Windows 2000 SP4