如何在c#.net服务失败后重启窗口服务? [英] how to window service restart after service failed in c# .net?

查看:171
本文介绍了如何在c#.net服务失败后重启窗口服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



c#.net服务失败后如何重启窗口服务?



我有一个窗口服务但是,我有一个问题,当我的服务失败时,我的Windows服务已停止。

我不想服务停止,我想服务重启后失败。



那么,怎么可能呢?



请帮帮我。



在此先感谢。



Ankit Agarwal

软件工程师

hello,

how to window service restart after service failed in c# .net?

I have a window service but, i have a problem with that, when my service failed so, my windows service ha been stopped.
I do'nt want the service stop, i want to service restart after failure.

So, How can it possible?

Please help me.

Thanks in Advance.

Ankit Agarwal
Software Engineer

推荐答案

您可以在服务属性对话框的恢复选项卡上为Windows服务配置恢复选项。在服务视图中右键单击您的服务,然后单击属性。



它允许您为第一次,第二次和后续的故障指定操作(例如重新启动)服务。





希望这会有所帮助,

Fredrik
You can configure recovery options for your windows service on the Recovery tab on the Service Properties dialog. Right-click your service in the service view and click properties.

It allows you to specify an action (such as Restart) for the first, second and subsequent failures of the service.


Hope this helps,
Fredrik


这篇关于如何在c#.net服务失败后重启窗口服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆