This documentation is archived and is not being maintained.

Team Foundation Build Tasks

MSBuild tasks are contained in targets, and provide the code that runs during the build process. A library of common tasks is provided with MSBuild. For more information, see MSBuild Task Reference.

Microsoft.TeamFoundation.Build.targets defines several default Team Foundation Build tasks that you can modify by setting their properties in the TfsBuild.proj file to customize certain actions. 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.

List of Default Tasks in Microsoft.TeamFoundation.Build.targets

The following tasks can be customized by modifying their properties.

Team Foundation Build Task Associated target

Get Task

This 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

This task labels all source files of a specified workspace.


GenCheckinNotesUpdateWorkItems Task

This task generates the list of all changesets and work items which were created or affected during a build. Labels are used to tag a particular build.

GetChangeSetsAndUpdateWorkitems target is invoked if the build is succesful.

GetChangeSetsOnBuildBreak target is invoked if the build is not succesful.

CreateNewWorkItem Task

This task creates a new work item for failures during the build process. The Found In field in the work item is updated with a link to the specific build number.


CreateWorkspaceTask Task

This task creates a new workspace on the build computer by using the workspacemapping.xml file.


DeleteWorkspaceTask Task

This task deletes the workspace that was 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

This task creates the drop folder at drop site and updates the build number.


TestToolsTask Task

This task runs a set of tests during the build and publishes the results.


Modifying Team Foundation Build Tasks

To modify the tasks defined in Microsoft.TeamFoundation.Build.targets, examine the properties of the task that you want to modify, and set those properites in the TfsBuild.proj file of 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 on build failure, you 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>

See Also