安裝C# Windows服務程序
1、
在服務程序的是設計窗體中,點擊右鍵“添加安裝程序”,添加服務安裝程序。否則,安裝時會出現如下
錯誤:
正在安裝程序集“C:/Program/xx.exe”。
受影響的參數是:
logtoconsole =
assemblypath = C:/Program/xx/xx.exe
logfile = C:/Program/xx.InstallLog
沒有 RunInstallerAttribute.Yes 的公共安裝程序。在 C:/Program/xx.exe 程序集中可能可以找到
“Yes”屬性。
正在提交程序集“C:/Program/xx.exe”。
受影響的參數是:
logtoconsole =
assemblypath = C:/Program/xx.exe
logfile = C:/Program/xx.InstallLog
沒有 RunInstallerAttribute.Yes 的公共安裝程序。在 C:/Program/xx.exe 程序集中可能可以找到
“Yes”屬性。
2、
將serviceProcessInstaller1->Accout屬性,設爲:LocalSystem(默認是User)。
否則將會出現如下錯誤:
windows服務安裝時,出錯:System.ComponentModel.Win32Exception: 帳戶名無效或不存在,或者密碼對
於指定的帳戶
3、
安裝:
C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/InstallUtil.exe FilePath/xx.exe
卸載:
C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/InstallUtil.exe -u FilePath/xx.exe