FIX:停止或暫停托管的 Windows 服務時收到“Error 1053:The service did not respond to the start or control request in a timely fashion”(錯誤 1053:服務沒有及時響應啟動或控制請求)錯誤信息
https://support.microsoft.com/zh-cn/kb/885055
症狀
Could not stop the
Windows service name service on Local Computer.
Error 1053:The service did not respond to the start or control request in a timely fashion.
注意:Windows service name 是您已創建的 Windows 服務名稱的占位符。
Error 1053:The service did not respond to the start or control request in a timely fashion.
原因
解決方案
885055 如何獲取 Microsoft .NET Framework 1.1 Service Pack 1
狀態
更多信息
重現此問題的步驟
- 創建一個 Windows 服務項目。為此,請按照下列步驟操作:
- 使用 Microsoft Visual Basic .NET 創建一個 Windows 服務項目。將該 Windows 服務命名為 SampleWS。
- 在 SampleWS 的“屬性”窗口中,將 CanPauseAndContinue 屬性、CanShutDown 屬性和 CanStop 屬性設置為 True。
- 將 ServiceName 屬性設置為 SampleWS。
- 在 Service1.vb 文件的代碼視圖中,在該文件開頭添加以下代碼以便將 System.Threading 名稱空間導入此項目中。
導入 System.Threading
- 將 OnPause 方法添加到 Service1.vb 文件中。
- 將以下代碼添加到 OnStop 方法和 OnPause 方法中。
Thread.Sleep(40000)
- 將 ServiceProcessInstaller1 安裝程序和 ServiceInstaller1 安裝程序添加到 SampleWS 項目中。
- 在 ServiceProcessInstaller1 安裝程序的“屬性”窗口中,將 ServiceProcessInstaller1 安裝程序的Account 屬性設置為 LocalSystem。
- 在 ServiceInstaller1 安裝程序的“屬性”窗口中,將 StartType 屬性設置為 Automatic。
- 生成 SampleWS 應用程序。
- 創建一個 Setup 項目,然后將 SampleWS 應用程序的輸出添加到該 Setup 項目中。
- 生成 SampleWS 解決方案。
- 找到 Setup1.msi 文件。此文件位於步驟 2 中創建的 Setup1 項目文件夾中。
- 雙擊“Setup1.msi”文件以安裝 SampleWS Windows 服務。
- 單擊“開始”,單擊“運行”,在“打開”框中鍵入 services.msc,然后單擊“確定”。Microsoft 管理控制台 (MMC) 管理單元“服務”隨即打開。
- 在右窗格中,找到 SampleWS 服務,然后啟動此服務。
- 停止或暫停 SampleWS 服務。
有關其他信息,請單擊下面的文章編號,以查看 Microsoft 知識庫中相應的文章:
824684用於描述 Microsoft 軟件更新的標准術語說明
參考
注意:本篇“快速發布”文章是從 Microsoft 支持組織直接創建的。 文中包含的信息按原樣提供,用於響應緊急問題。 由於發布倉促,材料可能包含印刷錯誤,並且可能隨時修訂,恕不另行通知。 有關其他注意事項,請參閱使用條款。
屬性
文章 ID:839174 - 上次審閱時間:12/08/2015 06:45:07 - 修訂版本: 1.0
- Microsoft .NET Framework 1.1
- kbnosurvey kbarchive kbqfe kbhotfixserver kbnetframe110sp1fix kbserviceprocess kbservice kbbug kbfix kbnetframe110presp1fix KB839174