MSBuild is powerful general purpose build engine, but what if you have a dedicated build server running Team Foundation Server Build? Did you know that you can execute Team Build projects locally and even debug them with MSBuild Sidekick? In this post we shall show how to do that in three simple steps (for Visual Studio Team Foundation Server 2008).
Prior to debugging you need to know about several limitations desktop build has comparing to Team build running on the server. From MSDN article "How to: Build Team Projects on a Desktop":
- The desktop builds perform only the compilation and tests.
- They do not perform other public build steps such as getting sources from version control, updating work items, labeling sources, creating new work items, and copying to drop locations
- The default MSBuild logger logs the results because the Team Foundation Build logger is not enabled for desktop builds.
- The desktop builds do not store build data in the database.
- They do not generate any status reports. Build output is written to console. You can learn more details by enabling the Verbosity option when running the MSBuild command. For more information, see MSBuild Command Line Reference.
1. Follow the directions in the article to get you all prerequisites for building Team Build projects locally in order.
2. Open local copy of Team Build project file from previous step with MSBuild Sidekick and define TeamBuildRefPath property in "Project Properties" pane. To do so access "Build" -> "Build Options" menu item, and then click "Project Properties" icon at the left pane and add TeamBuildRefPath property with its value set to "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\" (or different drive where you have VS 2008 installed).
Reload project by clicking "File" -> "Reload". A few warnings you still see do not affect further debugging.
3. Your Team Build project is now ready for debugging. You may start debugging by clicking Debug toolbar button or pressing F5 key.
You can learn more about debugging and how to use it efficiently from our previous posts “How to debug step-by-step with MSBuild Sidekick” and “How to review Properties & Items while debugging with MSBuild Sidekick”.