我试图通过services.msc运行Windows服务。我收到了以下错误。 [英] I am trying to run the windows service through services.msc. I am getting following error.

查看:70
本文介绍了我试图通过services.msc运行Windows服务。我收到了以下错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Services
---------------------------
Windows could not start the Window Service service on Local Computer.



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





我正在尝试压缩pdf。如果pdf大小超过30 mb,我会遇到错误。



我尝试过:



我已完成注册表中的以下更改





I am trying to compress the pdf. If the pdf size is greater than 30 mb i am getting above error.

What I have tried:

I had Done Following changes in registry

Create the registry entry for the Services Pipe Timeout and give it higher than the default value:
Start the registry editor (regedit.exe)
navigate to the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
Right-click on the above key and choose New, then DWORD Value
Type ServicesPipeTimeout as the name for it and press ENTER
Right-click on the ServicesPipeTimeout value and choose to Modify it
In the Base section click Decimal
In the Value data text box type for example 180000 as the value of timeout period and click OK
Restart the computer





然后它也会出现同样的错误。



Then also it is giving same error.

推荐答案

Windows服务的启动只是该服务的一个开始,包括其配置。它完全不是为了创建服务所做的工作。这项工作必须在启动后完成。
The startup of a Windows Service is just a start of that service including its configuration. It is not at all meant for doing the work the service was created for. That work has to be done after startup.


在OnStart中使用计时器来执行您想要的操作,以免阻止OnStart按时返回。



在调用OnStart后几秒钟内不要执行操作(压缩等等),从而不会阻塞并导致超时。



如果你考虑一下 - 它确实超时 - 你能想象有很多服务长时间阻止服务管理器吗?
Use a timer in your OnStart to perform the action you want so as not to block the OnStart from returning on time.

Don't do your action (compressing etc..) for a few seconds after the OnStart has been called thereby not blocking and causing a timeout.

If you think about it - it's good that it does time out - can you imagine having quite a few services blocking the service manager for extended periods of time?


这篇关于我试图通过services.msc运行Windows服务。我收到了以下错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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