Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I couldn't find the solution I was looking for, but here's what I came up with in the end. </p> <p>I wanted to keep the solution simple and configurable within the TFS arguments while at the same time staying in line with the already provided <code>MSBuildArguments</code> method which has been promoted a lot. So I created a new Build Template, and added a new TFS WorkFlow Argument called <code>MSBuildArguments2</code> in the Arguments tab of the WorkFlow.</p> <p><img src="https://i.stack.imgur.com/nLXZQ.png" alt="alt text"></p> <p>I searched through the BuildTemplate WorkFlow for all occurances of the <code>MSBuildArguments</code> (there were two occurances). </p> <p>The two tasks that use <code>MSBuildArguments</code> are called <code>Run MSBuild for Project</code>. Directly below this task, I added a new "If" block with the condition:</p> <pre><code>Not String.IsNullOrEmpty(MSBuildArguments2) </code></pre> <p>I then copied the "Run MSBuild for Project" task and pasted it into the new If's "Then" block, updating its title accordingly. You'll also need to update the new Task's ConmmandLineArguments property to use your new Argument.</p> <p><code>CommandLineArguments = String.Format("/p:SkipInvalidConfigurations=true {0}", MSBuildArguments2)</code></p> <p>After these modifications, the WorkFlow looks like this:</p> <p><img src="https://i.stack.imgur.com/a7hRK.png" alt="alt text"></p> <p>Save and Check In the new WorkFlow. Update your Build Definition to use this new WorkFlow, then in the build definition's Process tab you will find a new section called Misc with the new argument ready to be used. Because I'm simply using this new argument for deployment, I copied the exact same arguments I used for <code>MSBuild Arguments</code> and updated the MSDeployServiceURL to my second deployment server.</p> <p><img src="https://i.stack.imgur.com/ZjfO1.png" alt="alt text"></p> <p>And that's that. I suppose a more elegant method would be to convert MSBuildArguments into an array of strings and then loop through them during the WorkFlow process. But this suits our 2 server requirements.</p> <p>Hope this helps!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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