2011-03-29 58 views
5

我最近試圖更改我的Windows服務的顯示名稱,但顯然我搞砸了。舊版本無法完全卸載,我無法安裝新版本的Windows服務。這是運行installutil/i myService時產生的錯誤:我的服務無法卸載

An exception occurred during the uninstallation of the System.Diagnostics.EventLogInstaller installer. 
System.InvalidOperationException: The event log source '7 Ac Service' cannot be deleted, because it's equal to the log name. 
An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be fully uninstalled after the uninstall is complete. 

因此事件日誌源等於日誌名稱。這是什麼意思,我該如何解決它?

+0

可能的重複:http://stackoverflow.com/questions/5353736/cannot-uninstall-a-windows-service-cannot-be-deleted-because-its-equal-to – Anuraj 2011-03-29 09:04:37

回答

8

我發現自己。 This post幫助。所以在註冊表中基本上有三個地方與Windows服務同名。所以我試着先寫一個控制檯應用程序來刪除eventlog:

System.Diagnostics.EventLog.Delete("7 Ac Service"); 

它照顧了其中2個。我使用regedit手動刪除了最後一個。然後我的Windows服務安裝沒有問題。