Bookmark and Share

MSBuild as a Visual Studio 2010 Tool

The posts I see for setting up MSBuild on the tool menu in Visual Studio assume that you want to build the current project. If you’re working with custom msbuild files, this will not be the case. Here’s how you can set up MSBuild in Visual Studio 2010 to compile the currently selected build script and output it to the Output window.

In my situation, I have multiple build scripts for demonstration purposes.

BuildFiles

Then open the Tools menu and select “External Tools…” A dialog will appear. Click the ‘Add’ button, and type MSBuild in the name text box. Browse for MSBuild.exe in the command text box, my copy was C:\Windows\Microsoft.NET\Framework64\v4.0.30128\MSBuild.exe. For the Arguments text box, type $(ItemPath). Check “Use Output window.” Your window should look like mine below.

MSBuildTool

The key here is using the ItemPath property as the argument. This uses the full path and filename of the selected item in Solution Explorer

blog comments powered by Disqus

KodefuGuru.GetInfo()

Chris Eargle
LinkedIn Twitter Technorati Facebook

Chris Eargle
Telerik Developer Evangelist, C# MVP

JustCode

Telerik .NET Ninja

 

INETA Community Speakers Program

 

MVP - Visual C#

 

Friend of RedGate

World Map

Tag cloud

Month List

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.