Skip to end of metadata
Go to start of metadata

This page contains reference information for the MSBuild Build Runner fields.

Icon

The MSBuild runner requires .Net Framework or Mono installed on the build agent. Microsoft Build Tools 2013-2017 are supported.

Before setting up a build configuration to use MSBuild as the build runner, make sure you are using an XML build project file with the MSBuild runner.

To build a Microsoft Visual Studio solution file, you can use the Visual Studio (sln) build runner.

General Build Runner Options

Option

Description

Build file path

Specify the path to the solution to be built relative to the build checkout directory. For example:

Working directory

 Optional. Specify the path to the build working directory if it differs from the build checkout directory.

MSBuild version

Select the MSBuild version: .NET Framework, Mono xbuild or Microsoft Build Tools.

MSBuild ToolsVersion

Specify here the version of tools that will be used to compile (equivalent to the /toolsversion: commandline argument).

Icon

MSBuild supports compilation to older versions, thus you may set MSBuild version as 4.0 with MSBuild ToolsVersion set to 2.0 to produce .NET 2.0 assemblies while running MSBuild from .NET Framework 4.0. For more information, refer to http://msdn.microsoft.com/en-us/library/bb383796(VS.100).aspx

Run platform

From the drop-down list select the desired execution mode on a x64 machine.

Targets

A target is an arbitrary script for your project purposes. Enter targets separated by spaces. The available targets can be viewed in the Web UI by clicking the icon next to the field and added by checking the appropriate boxes.

Command line parameters

Specify any additional parameters for MSBuild.exe.

Reduce test failure feedback time

Use this option to instruct TeamCity to run the tests which failed in the previous builds before others.

Code Coverage

To learn about configuring code coverage options, please refer to the Configuring .NET Code Coverage page.

Implementation notes

MSBuild runner generates an MSBuild script that includes user's script. This script is used to add TeamCity-provided MSBuild tasks. Your MSBuild script will be included with the <Import> task. If you specified a Visual Studio solution file, it will be called from the <MSBuild> task. To disable it, set teamcity.msbuild.generateWrappingScript to false.



See also:

2 Comments

  1. A note on how to make MSBuild run from command line runner report output to TeamCity.

  2. In the example of "Build file path" should be a *. proj file (and not a *.sln).