I’m a real fan of MSBuild Scripts, I always use a lot of MSBuild Tools in my projects (for example scripts that automatically get latest version of the code, compile, check-in, …).
The easier way I found to execute those scripts is to run them automatically while I am clicking on a button into my Visual Studio.
STEP 1: Creation of an external tool
In Visual Studio 2010, Click on “Tools” menu, “External Tools …”.
A pop-up appears, click Add button and enter the desired information.
“Title” textbox is used as the name of the button that will be created.
If you use MSBuild on a X64 operating System, you have to select x86 MSBuild version:
Click on “Use Output window” checkbox to redirect the result of your MSBuild script into Visual Studio Output window.
Step2 : Creation of your Toolbar and affectation of the external tool
On the menu bar, right click and select “Customize …”.
A pop-up appear, create your desired toolbar. Name it MyToolbar and click OK.
Click on the “Commands” tab and click on ToolBar radio button to select the newly created external tool.
Select MyToolBar and click on “Add Command …” button.
On the left lit item, select “Tools” and than select the “External Command x” item where X is the index of your tool that appears in the “Tool” menu (starting index => 1). In my example “External Command 6”.
Click “Ok” and than “Close”.
And here is the result 🙂