How to: Build Team Projects on a Desktop
Team Foundation Build provides a desktop build feature for building solutions and running tests on local binaries before checking the changes into the public Team Foundation source control server. Desktop builds behave differently from public builds in the following ways:
Only the compilation and tests are performed.
Other public build steps such as getting sources from source control, updating work items, labeling sources, creating new work items, and copying to drop locations are not performed in desktop builds
The default MSBuild logger is used for logging results because the Team Foundation Build logger is not enabled for desktop builds.
Build data is not stored in the database.
No status reports are generated. Build output is written to console; you can learn more details by enabling the Verbose option when running the MSBuild command.
For information about how to create a public build, see How to: Run a Build on a Build Type.
The following procedure demonstrates how to perform a desktop build.
Required Permissions
To perform this procedure, you must be a member of the Administrators security group on the computer where you are building. For more information, see Team Foundation Server Permissions.
To run a desktop build
Synchronize the team project root directory to a directory on the local computer. For more information, see How to: Get the Source for your Team Project.
Note
Team Foundation Build stores all build type files in source control, and uses a directory named TeamBuildTypes under the team project root folder
Use the MSBuild command from the Visual Studio command prompt (click Start, click All Programs, click Microsoft Visual Studio 2005, click Visual Studio Tools, and then click Visual Studio 2005 Command Prompt) and use the build type file as the argument as shown in the following syntax:
C:\temp\Team Project1\TeamBuildTypes\Main> MSBuild TfsBuild.proj /p:SolutionRoot=..\..
Note
If the source has already been synchronized to a directory, for example d:\temp\mysources\solution1, you can synchronize the build type file with another directory, for example: c:\temp. Use the command as was mentioned earlier except specify the location of your sources. The command syntax is:
MSBuild TfsBuild.proj /p:solroot= d:\temp\mysources
You can override any property using the command line with the /p switch. The required properties for desktop build are SolutionRoot and TeamBuildRefPath.
The optional properties for desktop build that can be overridden are:
Verbose
RunFxCopFlag
The following commands provide additional syntax for Team Foundation Build desktop builds:
To perform an incremental build and run tests:
msbuild TfsBuild.proj
To perform a clean operation for the binaries and all intermediate obj-folders:
msbuild TfsBuild.proj /t:Clean
To perform an incremental compilation:
msbuild TfsBuild.proj /t:Compile
To run only tests:
msbuild TfsBuild.proj /t:Test
To perform a clean, full compilation and run tests:
msbuild TfsBuild.proj /t:DesktopRebuild
To override the output directory by overriding the BinariesRoot where product binaries get copied and the TestResultsRoot where test results get saved:
msbuild TfsBuild.proj /p:BinariesRoot=d:\NewBinariesRoot /p:TestResultsRoot=d:\NewTestResultsRoot
To disable code analysis in a desktop build:
msbuild TfsBuild.proj /p:RunCodeAnalysis=false
To disable test runs in desktop build:
msbuild TfsBuild.proj /p:RunTest=false
For more information about MSBuild command-line options, see MSBuild Command Line Reference.
See Also
Reference
MSBuild Command Line Reference
Concepts
Visual Studio Integration (MSBuild)
MSBuild Logging
MSBuild Properties