Window Service on Shutdown

  • Thread starter Thread starter tascien
  • Start date Start date
T

tascien

I created a window service...

When i stop the service through MMC, it can see in the EventLog that it
calls OnStop() within the service... and all stop handling routines are
processed gracefully...

but when i do, Start, ShutDown to restart the computer, the EventLog
does not show anything...

Can i trust that the OnStop was called anyway? If not, how to make sure
windows calls my OnStop before shutting down?

Thanks.
 
I created a window service...

When i stop the service through MMC, it can see in the EventLog that it
calls OnStop() within the service... and all stop handling routines are
processed gracefully...

but when i do, Start, ShutDown to restart the computer, the EventLog
does not show anything...

Can i trust that the OnStop was called anyway? If not, how to make sure
windows calls my OnStop before shutting down?

Override the OnShutdown method. That's what should be called when Windows
is shut down.
 
Still nothing in the eventLog.

I am just assuming the EventLog is closed when the computer is shutting
down... Isn't it?

Tascien
 
Back
Top