I have a service that installs, starts, stops, etc. just fine.
It uses a system.timers.timer to reschedule the handler.
I am not using threads because I want exactly 1 file to be processed
at a time.
The handler processes files, which occasionally takes several minutes
for large test files.
However, when I use the windows services manager to stop the service,
it immediately kills the process/thread, even when I comment out my
call to (ServiceBase(this)).Stop()
or call (ServiceBase(this)).RequestAdditionalTime()
Is there a way to leave the currently-running handler running until
completion after the service's OnStop() has been called?
Stuart Davies - 21 Jun 2007 12:04 GMT
In NET 2.0 onwards you can invoke the ServiceBase.RequestAdditionalTime
method within your OnStop handler.
http://msdn2.microsoft.com/en-us/library/system.serviceprocess.servicebase.reque
stadditionaltime(vs.80).aspx

Signature
Cheers
Stuart
"Is facio in meus apparatus"
> I have a service that installs, starts, stops, etc. just fine.
> It uses a system.timers.timer to reschedule the handler.
[quoted text clipped - 11 lines]
> Is there a way to leave the currently-running handler running until
> completion after the service's OnStop() has been called?