Export (0) Print
Expand All

Team Foundation Build Tasks

The MSBuild tasks are contained in targets. These tasks provide the code that runs during the build process. MSBuild provides a library of common tasks. For more information, see MSBuild Task Reference.

The MSBuild .targets file for Team Foundation Build, Microsoft.TeamFoundation.Build.targets defines several default Team Foundation Build tasks that you can customize by setting properties in the TfsBuild.proj file. For example, the CoreGet target includes a Get task that enables you to retrieve a specific changeset for a build type. By default, the Get task retrieves the latest files. For more information about .targets files, see MSBuild .Targets Files.

The following tasks can be customized by modifying their properties.

Team Foundation Build Task

Associated target

Get Task

Synchronizes the sources on the build computer. It also raises log events to inform the logger of every file and version retrieved into the local workspace.


Label Task

Labels all source files of a specified workspace.


GenCheckinNotesUpdateWorkItems Task

Generates the list of all changesets and work items that were created or affected during a build. Labels are used to tag a particular build.

GetChangeSetsAndUpdateWorkitems target is invoked if the build is successful.

GetChangeSetsOnBuildBreak target is invoked if the build is not successful.

CreateNewWorkItem Task

Creates a work item for failures that occur during the build process. Also, it updates the Found In field in the work item with a link to the specific build number.


CreateWorkspaceTask Task

Creates a new workspace on the build computer.


DeleteWorkspaceTask Task

Deletes the workspace created during the build execution. The actual files are not deleted from the build computer. If the specified workspace does not exist, DeleteWorkspaceTask issues a warning.


UpdateBuildNumberDropLocation Task

Creates a folder at a specified location to receive the built files. Also, it updates the build number.


TestToolsTask Task

Runs a set of tests during the build and publishes the results.


BuildStep Task

Inserts the build steps into the build.


GetBuildProperties Task

Outputs the initial values for the build properties.


SetBuildProperties Task

Sets any property on the build that can be set.


WorkspaceItemConverterTask Task

Converts the version control server items to local workspace items, and local items to version control server items.

ResolveSolutionPathsForEndToEndIteration and ResolveTestFilesForEndToEndIteration

To modify the tasks defined in the definition file Microsoft.TeamFoundation.Build.targets, examine the properties of the task that you want to modify, and then specify those properties in the TfsBuild.proj file for your Team Foundation Build build type. The CreateNewWorkItem task is defined as follows.

<!-- Create WorkItem for build failure -->
          ContinueOnError="true" />

To customize the work item that is created when a build fails, set the WorkItemFieldValues in the TFSBuild.proj file:


The following assumes that the Areapath and IterationPath properties have also been set.

<WorkItemFieldValues>Area Path=$(AreaPath);Iteration Path=$(IterationPath);Severity=1;Priority=0;Symptom=build break;Steps To Reproduce=Start the build using Team Build;Source=Development;How Found=Build Break;Assigned To=Active</WorkItemFieldValues>

Community Additions

© 2014 Microsoft