开发者

What is the easiest way to implement a self restarting service

开发者 https://www.devze.com 2022-12-08 06:00 出处:网络
I have got a windows service written in .NET and I need to be a开发者_Python百科ble to implement a self-restarting feature for it.

I have got a windows service written in .NET and I need to be a开发者_Python百科ble to implement a self-restarting feature for it.

E.g. service constantly monitors the environment in runs in and once a value of the environmental variable reaches its threashold value the service must restart itself.

What would be the easiest way to do it?


Have your app monitor the environment variable, and exit when it should, set the service to restart under the recovery tab for the service. You can do this programmatically if you use code to install the service.


Write a Service to start the Service!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号