Win7環境,使用Topshelf注冊服務失敗,建議關閉殺毒軟件,並找到殺毒軟件的防護進程,一並關閉。手動結束防護進程可能會提示:拒絕訪問,這時候可以嘗試卸載殺毒軟件,再次進行安裝。
已完成事務處理安裝。
Topshelf.HostFactory Error: 0 : The service terminated abnormally, System.InvalidOperationException: 安裝失敗,已執行回滾。 ---> System.UnauthorizedAccessException: 嘗試執行未經授權的操作。
在 Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
在 Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind)
在 Microsoft.Win32.RegistryKey.SetValue(String name, Object value)
在 Topshelf.Runtime.Windows.HostInstaller.Install(IDictionary stateSaver)
在 System.Configuration.Install.Installer.Install(IDictionary stateSaver)
在 System.Configuration.Install.TransactedInstaller.Install(IDictionary savedState)
--- 內部異常堆棧跟蹤的結尾 ---
在 System.Configuration.Install.TransactedInstaller.Install(IDictionary savedState)
在 Topshelf.Runtime.Windows.HostServiceInstaller.InstallService(Action`1 beforeInstall, Action`1 afterInstall, Action`1 beforeRollback, Action`1 afterRollback)
在 Topshelf.Runtime.Windows.WindowsHostEnvironment.InstallService(InstallHostSettings settings, Action beforeInstall, Action afterInstall, Action beforeRollback, Action afterRollback)
在 Topshelf.Hosts.InstallHost.Run()
在 Topshelf.HostFactory.Run(Action`1 configureCallback)