Window Service on Shutdown

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.
 
M

Mehdi

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.
 
T

tascien

Still nothing in the eventLog.

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

Tascien
 

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