我有C#編寫的,我需要安裝和調試的自定義Windows服務。當我使用installutil與Windows服務安裝,然後立即卸載定製窗口服務
installutil "[path].exe"
在命令行,然後嘗試與搜索服務,它不會出現在任何地方安裝的服務列表。縱觀安裝日誌文件,我看到:
Installing assembly 'myservice'.
Affected parameters are:
logtoconsole =
assemblypath = mypath
logfile = mylogfile
Installing service MyService
Service MyService has been successfully installed.
Creating EventLog source MyService in log Application...
Committing assembly 'myservice'.
Affected parameters are:
logtoconsole =
assemblypath = myservice
logfile = pathtoinstalllog
Uninstalling assembly myservice
Affected parameters are:
logtoconsole =
assemblypath = myservice
logfile = pathtoinstalllog
Removing EventLog source myservice.
Service myservice is being removed from the system...
Service myservice was successfully removed from the system.
Uninstalling assembly myservice'.
Affected parameters are:
logtoconsole =
assemblypath = myservice
logfile = pathtoinstalllog
Removing EventLog source myservice.
Service myservice is being removed from the system...
Service myservice was successfully removed from the system.
(名稱路徑,爲MyService,pathtoinstalllog等到位公司具體情況)
無論如何,從日誌文件時,它看起來好像服務正在安裝,然後立即卸載......
如果需要更多的代碼或信息,讓我知道,在此先感謝。
Should't您可以指定標誌'-i'把這件事告訴'install'? – Suhas
你在日誌文件中得到任何錯誤?這是來自installlog文件的完整日誌。同時檢查我們的代碼不會導致卸載 –
哦,我認爲這是默認值..無論哪種方式,它並沒有改變任何東西:\ –