Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto restart windows service

Tags:

c#

I am trying to a Window Service in C#, which should be running always. If there is a crash or shutdown, then it should automatically restart. I considered using Service controller class, but the problem is how to handle if both Service Controller & Service go down at same time. Is there a watchdog functionality in Windows with which I can register and it takes care of the service start up?

like image 937
Abhinav Avatar asked Dec 20 '22 16:12

Abhinav


1 Answers

You could consider using recovery options of service. It can be set through properties of the service when running services.msc.

Please look here and here for more information.

like image 70
pepo Avatar answered Jan 01 '23 04:01

pepo