3
我正嘗試從CI安裝使用TopShelf的服務。但是,無論何時在安裝期間發生異常,TopShelf回滾事務並繼續構建過程,返回0x0狀態。TopShelf MSDeploy在出錯時安裝退出代碼
這意味着就CI服務器而言,部署是成功的。
我使用的MSBuild命令的一個例子是:
<Message Text ="Installing Service" />
<Exec Command=""$(MSDeployPath)" -verb:sync -source:runCommand="$(RemoteServicePath) install /instance:$(DeployEnvironment)",dontUseCommandExe=false,waitAttempts=10,waitInterval=10000 -dest:auto,computername=%(ComputerName) -verbose -retryInterval:10000 -retryAttempts:10"></Exec>
我收到的輸出是:
[Exec] Running a transacted installation. <br>
[Exec] <br>
[Exec] Verbose: Received response from agent (HTTP status 'OK'). <br>
[Exec] Info: <br>
[Exec] Beginning the Install phase of the installation. <br>
[Exec] <br>
[Exec] Info: Installing service Foo...<br>
[Exec] <br>
[Exec] Info: Creating EventLog source Foo in log Application...<br>
[Exec] <br>
[Exec] Info: <br>
[Exec] An exception occurred during the Install phase.<br>
[Exec] <br>
[Exec] Info: System.ComponentModel.Win32Exception: The specified service already exists<br>
[Exec] <br>
[Exec] The Rollback phase of the installation is beginning.<br>
[Exec] Restoring event log to previous state for source Foo.<br>
[Exec] <br>
[Exec] The Rollback phase completed successfully.<br>
[Exec] <br>
[Exec] The transacted install has completed.<br>
任何想法如何,我可以使異常在構建失敗?
你有沒有使用退出代碼的例子? – dhaken 2012-10-15 15:13:09
'ur_service.exe安裝'然後'如果錯誤級別0轉到開心'和'如果錯誤級別1轉到bad_time' – 2012-10-19 03:16:59
我有從主返回標準的int代碼還是一個特殊的TopShelf類型? – dhaken 2012-10-23 13:00:35