Note that there are some explanatory texts on larger screens.

plurals
  1. POTopShelf MSDeploy Install Exit Code On Error
    text
    copied!<p>I'm trying to install a service using TopShelf from CI. However whenever an exception occurs during installation, TopShelf rollsback the transaction and continues with the build process, returning a 0x0 status.</p> <p>This means that as far as the CI server is concerned, the deployment was successful.</p> <p>An example of the command I'm using in MSBuild is:</p> <pre><code>&lt;Message Text ="Installing Service" /&gt; &lt;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"&gt;&lt;/Exec&gt; </code></pre> <p>The output I receive is:</p> <pre><code>[Exec] Running a transacted installation. &lt;br&gt; [Exec] &lt;br&gt; [Exec] Verbose: Received response from agent (HTTP status 'OK'). &lt;br&gt; [Exec] Info: &lt;br&gt; [Exec] Beginning the Install phase of the installation. &lt;br&gt; [Exec] &lt;br&gt; [Exec] Info: Installing service Foo...&lt;br&gt; [Exec] &lt;br&gt; [Exec] Info: Creating EventLog source Foo in log Application...&lt;br&gt; [Exec] &lt;br&gt; [Exec] Info: &lt;br&gt; [Exec] An exception occurred during the Install phase.&lt;br&gt; [Exec] &lt;br&gt; [Exec] Info: System.ComponentModel.Win32Exception: The specified service already exists&lt;br&gt; [Exec] &lt;br&gt; [Exec] The Rollback phase of the installation is beginning.&lt;br&gt; [Exec] Restoring event log to previous state for source Foo.&lt;br&gt; [Exec] &lt;br&gt; [Exec] The Rollback phase completed successfully.&lt;br&gt; [Exec] &lt;br&gt; [Exec] The transacted install has completed.&lt;br&gt; </code></pre> <p>Any ideas how I can make the build fail on the exception?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload