gln
gln

Reputation: 1031

WindowsService.OnStop()

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

Answers (1)

aleroot
aleroot

Reputation: 72646

Yes when you restart the service is called

Stop() 

and then :

Start()

The “OnStop” event handler

The “OnStop” event handler is being triggered when the EventLogger Service is being stopped or restarted.

Upvotes: 2

Related Questions