错误 1053:服务没有及时响应启动或控制请求 [英] Error 1053: the service did not respond to the start or control request in a timely fashion

查看:44
本文介绍了错误 1053:服务没有及时响应启动或控制请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近继承了几个作为 Windows 服务运行的应用程序,但我在为它们提供 gui(可从系统托盘中的上下文菜单访问)时遇到问题.

I have recently inherited a couple of applications that run as windows services, and I am having problems providing a gui (accessible from a context menu in system tray) with both of them.

我们需要一个 Windows 服务的 gui 的原因是为了能够重新配置 Windows 服务的行为,而不必求助于停止/重新启动.

The reason why we need a gui for a windows service is in order to be able to re-configure the behaviour of the windows service(s) without resorting to stopping/re-starting.

我的代码在调试模式下运行良好,并且出现了上下文菜单,并且一切正常等.

My code works fine in debug mode, and I get the context menu come up, and everything behaves correctly etc.

当我使用命名帐户(即,不是本地系统帐户)通过installutil"安装服务时,服务运行良好,但不在系统托盘中显示图标(我知道这是正常行为,因为我没有与桌面交互"选项).

When I install the service via "installutil" using a named account (i.e., not Local System Account), the service runs fine, but doesn't display the icon in the system tray (I know this is normal behavior because I don't have the "interact with desktop" option).

这里是问题所在 - 当我选择LocalSystemAccount"选项并选中与桌面交互"选项时,该服务需要 AGES 才能无明显原因启动,而我只是不断收到

Here is the problem though - when I choose the "LocalSystemAccount" option, and check the "interact with desktop" option, the service takes AGES to start up for no obvious reason, and I just keep getting

无法在本地计算机上启动 ... 服务.

错误 1053:服务没有及时响应启动或控制请求.

Could not start the ... service on Local Computer.

Error 1053: the service did not respond to the start or control request in a timely fashion.

顺便说一句,我通过注册表黑客将 Windows 服务超时从默认的 30 秒增加到 2 分钟(参见 http://support.microsoft.com/kb/824344,在第3部分搜索TimeoutPeriod,但是服务启动还是超时.

Incidentally, I increased the windows service timeout from the default 30 seconds to 2 minutes via a registry hack (see http://support.microsoft.com/kb/824344, search for TimeoutPeriod in section 3), however the service start up still times out.

我的第一个问题是 - 为什么本地系统帐户"登录比使用非 LocalSystemAccount 服务登录时花费的时间更长,导致 Windows 服务超时?这两者之间有什么区别会导致启动时出现如此不同的行为?

My first question is - why might the "Local System Account" login takes SOOOOO MUCH LONGER than when the service logs in with the non-LocalSystemAccount, causing the windows service time-out? what's could the difference be between these two to cause such different behavior at start up?

其次 - 退后一步,我想要实现的只是一个提供 gui 配置的 Windows 服务 - 我很乐意使用非本地系统帐户(使用命名用户/pwd),如果我可以让服务与桌面交互(也就是说,从系统托盘中有一个上下文菜单可用).这可能吗,如果可以,怎么办?

Secondly - taking a step back, all I'm trying to achieve, is simply a windows service that provides a gui for configuration - I'd be quite happy to run using the non-Local System Account (with named user/pwd), if I could get the service to interact with the desktop (that is, have a context menu available from the system tray). Is this possible, and if so how?

对上述问题的任何指示将不胜感激!

Any pointers to the above questions would be appreciated!

推荐答案

在与这条消息争论了几天之后,一位朋友告诉我你必须使用 Release 版本.当我 InstallUtil 调试版本时,它给出了这个消息.发布版本启动良好.

After fighting this message for days, a friend told me that you MUST use the Release build. When I InstallUtil the Debug build, it gives this message. The Release build Starts fine.

这篇关于错误 1053:服务没有及时响应启动或控制请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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