February 6, 2010

Debugging Team Build with MSBuild Sidekick

Filed under: MSBuild Sidekick,tfs,Uncategorized — Tags: , , — nikolays @ 1:00 pm

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).

Project Properties

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.

Debug  Window

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”.

May 15, 2009

How to review Properties & Items while debugging with MSBuild Sidekick

Filed under: MSBuild Sidekick — Tags: , , , — nikolays @ 8:27 am

In the recent post we described the basics of debugging typical MSBuild project.

In this post we shall touch upon important feature of MSBuild Sidekick debugger – namely inspecting Property and Item values during debugging with Globals and Autos windows.

The walkthrough below will show how to review Property and Item values while debugging:

1. Start debugging project in step-by-step mode (see previous post)

2. When Target/Task is selected (highlighted with bold border in Debug window) click on View > Globals Window and View > Autos Window menu.

View main menu

Globals and Autos windows will appear at bottom pane of main application window.
Note: you may simply change these windows position by dragging-and-dropping them anywhere on application window.

Globals window displays Property and Item values as they are evaluated during the build execution.

Globals window

Autos window is similar to Globals window but displays only Properties/Items that are defined as input or output parameters for Target/Task element to be executed at the next step as you step through the project.

Autos window

3. Now let’s review the data. One can use Show combo box to switch between Properties and Items view mode.
Data is organized as a table with the following columns:
* Property/Item name
* Property/Item current value

Globals window - dropdown

4. You may also use Filter text box to filter currently visible elements based on element name.

Globals window - filter

5. As you click on "Debug Step" button and debug step-by-step you may see that Properties/Items that have been changed on previous step are highlighted in red.

Globals window - highlighted properties

© 2006-2008 Attrice Corporation. Last updated 06-Mar-2009 Contact us