DLM Automation

Passing Visual Studio Team Services build properties to MSBuild

Visual Studio Team Services (VSTS) doesn't pass the build number and binaries directory as variables to MSBuild by default. If you're using the MSBuild scripts, you'll need to follow the manual steps described here to avoid builds failing. 

You must also follow the configuration steps described in Use the TFS MSBuild scripts.

If you're using a xaml build:

  1. In Visual Studio, open your build definition for editing.
  2. Click Process.
  3. In the Build process parameters areas, expand the Advanced heading and click in the MSBuild Arguments field.
  4. Paste the following into the field:

    /p:tfs_buildNumber=$(Build.BuildNumber) /p:tfs_binariesDirectory=$(Agent.BuildDirectory)
  5. Press Ctrl+S to save the build definition.

If you're using a vNext build:

  1. Open your build definition.
  2. Click Edit and select the MSBuild step
  3. Paste the following into MSBuild Arguments field:

    /p:tfs_buildNumber=$(Build.BuildNumber) /p:tfs_binariesDirectory=$(Agent.BuildDirectory)

  4. Click Save.

 


Didn't find what you were looking for?