Home All Groups Group Topic Archive Search About

OnShutdown not executing in Windows service.

Author
22 Dec 2005 2:23 PM
Peter Meinl
Restarting Windows seems not to fire the OnShutdown event in the Windows
Service. Does not work on Windows XP SP2 and not on Windows 2003 Server SP1.
OnStart and OnStop do work fine.

Steps to reproduce:
Create a Windows service in VB.NET using VS 2005.
Set CanShutdown property to true.

Implement
Protected Overrides Sub OnShutdown()
Diagnostics.EventLog.WriteEntry(Me.ServiceName, "Shutdown")
End Sub

Start Service and Reboot.

AddThis Social Bookmark Button