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!
精彩评论