我在启动Windows服务时遇到问题。它被配置为自动启动,并且通常会启动。在有时没有,特别是在Windows 8Winsows服务未能启动
窗户日志包含以下错误:
The XYZ service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion. A timeout was reached (30000 milliseconds) while waiting for the XYZ service to connect.
这是一个.NET 2.0的服务。
问题的标准原因是执行长同步操作的OnStart方法。这次这不是问题。事实上,我在OnStart方法的开头放置了一个文件记录器,看起来它根本没有被调用。
是的,这将在大多数情况下工作。但在我的情况下,实际的OnStart()方法甚至没有被调用。证书的验证由OS执行(但包含在服务超时中)。似乎像一个操作系统的bug :) –
@ andrew.fox,对不起,我现在看到你以前的答案。也许这是不是在你的系统允许的,但[本MS Technet文章(http://technet.microsoft.com/en-us/library/cc756342%28WS.10%29.aspx)可以提供帮助。 –