Windows Service -> Stop immediately stops service, despite RequestAdditionalTime()

M

mjurban

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top