Windows服务错误 [英] Windows Service Error

查看:123
本文介绍了Windows服务错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经在C#中完成了Windows服务,但是自启动服务以来出现了错误.我已经搜索了解决方案,但是找不到.
如果有人遇到同样的问题,请帮助我.
错误提示:

错误1053,服务未及时响应启动或控制请求

在此先感谢

Hi,

I have done a windows service in c# but I''m having error since I started the service. I have searched for the solution but I couldn''t find one yet.
If anyone faced with the same problem please help me.
The error says:

error 1053 the service did not respond to the start or control request in a timely fashion

Thanks in advance

推荐答案

在服务OnStart处理程序中,您要么花费了很长的时间(最多30秒)
甚至永不退出.请仅使用OnStart实例化您的服务模型并启动服务的主线程.如果要复杂化服务模型的构建过程,则可能还需要很长时间.在这种情况下,您应该只启动将构建您的服务模型的线程,然后再启动服务主线程.


干杯


曼弗雷德(Manfred)
In the services OnStart handler you are either taking to long (max 30 secs)
or even never exit. Please use OnStart only to instantiate your service model and fire up the service''s main thread. If the building process for the services model is to convoluted it might also take too long. In that case you should only start a thread that will build your service model and then start the services main thread.


Cheers


Manfred


这篇关于Windows服务错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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