Reputation: 1031
I wrote a service in C#, and I overrode the function OnStop
.
Will this function be called when I restart the service, or only when I stop it?
Upvotes: 0
Views: 425
Reputation: 72646
Yes when you restart the service is called
Stop()
and then :
Start()
The “OnStop” event handler is being triggered when the EventLogger Service is being stopped or restarted.
Upvotes: 2