April 22, 2009

How to debug step-by-step with MSBuild Sidekick

Filed under: MSBuild Sidekick — Tags: — nikolays @ 7:29 pm

Have you ever tried to debug MSBuild project? If you did, in all probability you had to resort to introducing extra Message tasks into the project to output status during project execution; and then execute build and review the logs time after time to identify the problems (perhaps adding more Message tasks as you proceed).

Now you can debug your projects without ever adding extra "Message" tasks while reviewing build execution in real time – jut use MSBuild Sidekick debugger and resolve problems in your builds in no time.

In this post we shall show how to debug typical C# console project with MSBuild Sidekick.

1. Create new C# Console Application project with Visual Studio and open the project with MSBuild Sidekick.

2. Click Debug Step button (or press F11 key) to start step-by-step debug.

3. You can see now build execution order in Debug Window that should appear automatically. You may also open Debug Window by clicking on View -> Debug Window menu item.
Note: Debug window appears in floating mode when it is opened for the first time. To make Debug window docked drag-n-drop it at desired location on MSBuild Sidekick main application window.

4. Once in Debug mode, you can debug step-by-step by clicking Debug Step button (or pressing F11 key). MSBuild Sidekick highlights diagram elements differently depending on their current status:
* Current Target \Task is always highlighted with bold border
* Targets\Tasks that were successfully executed are highlighted in green
* Targets\Tasks that were skipped are highlighted in yellow
* Targets\Tasks that are not yet processed are not highlighted
Note: You may always see color coding rules by expanding legend which is collapsed at bottom of Debug Window.

5. To stop build execution on a specific Target\Task you may set breakpoint on it. To set breakpoint for Target\Task open right-click context menu and choose Toggle Breakpoint item.

6. Target\Task with breakpoint becomes marked with red circle.

7. Click Debug button (or press F5 key) to continue debugging.

8. Once build execution reaches Target\Task with breakpoint set, MSBuild Sidekick will switch into step-by-step debug mode. Current Target/Task will be highlighted with bold border around it in Debug window.

April 8, 2009

How to use MSBuild Extension Pack tasks with MSBuild Sidekick

Filed under: MSBuild Sidekick — Tags: , — nikolays @ 12:37 pm

One of the most exciting and widely accepted projects in MSBuild community is MSBuild Extension Pack tasks. MSBuild Extension pack provides a collection of over 240 MSBuild tasks you may use in your MSBuild projects for free!

In MSBuild Sidekick v 2.3 we introduced integration with MSBuild Extension Pack tasks; now you can add, edit properties and view online help for all the MSBuild Extension Pack tasks in the Sidekick application.

To illustrate these features let’s create new MSBuild project in MSBuild Sidekick v2.3 and add a MSBuild Extension Pack task to it.

Note: you should have MSBuild Extension Pack properly installed; it is available at http://www.codeplex.com/MSBuildExtensionPack.

1. Right click on Target element and choose "Add Task" from context menu.

Task context menu

2. In the "Add Task" dialog choose "Custom Tasks" tab – you should see there all the MSBuild Extension Pack task classes.

Add Task dialog

3. Then click on task class you’re going to use in your project, click "Add" button and click "Close" to leave dialog window.
Note: you can add multiple tasks using "Add Task" dialog by clicking "Add" button multiple times.

Add Task dialog buttons

4. Choose relevant task action in TaskAction property drop-down for your new task.

TaskAction property dropdown

5. Once task action is selected, the task parameters list will be filtered automatically, so that only task parameters relevant for the selected task action will be displayed. Required input parameters will be marked with asterisk (see Format parameter on the screenshot above).

6. To view online help for the selected MSBuild Extension Pack task navigate to Help window.

Task element online help

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