I have a VB.NET Windows Service that I wrote and it works fine. In VB.NET there is an overrideable method called OnStop() that gets called when the service is stopped. However, it appears it only gets stopped if someone actually stops the service from the Services MMC Console Window.
My question is, is there an event or an overridable method that gets called whenever the service stops, regardless of how it got stopped (e.g. Computer reboots, Exception occured and shut down service, etc....)?