我在啓動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)可以提供幫助。 –