MSBuild Tutorial # 2

No Comments October 15, 2012

Two things today…

First…so that we can have fun with MSBuild…here’s how you would configure Notepad++ to run MSBuild files…

  1. Hit F6 to open the Execute dialog of Notepad++
  2. Paste in the following into the Command(s) box…
    "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe" $(FULL_CURRENT_PATH)" You need to verify your path to MSBuild but it should work for most of you unless you have a 32-bit machine.
  3. Click the Save… button and give the command a name.  I called it Run MSBuild.
  4. Click the Cancel dialog.
  5. Any time you want to run a build script just hit F6 and select Run MSBuild from the drop down.

Now on to MSBuild. 

Here is the anatomy of an MSBuild file…

enter image description here

IF you want to try it here is the raw text…

Try to run it.  It won’t work.  All MSBuild files have one required target…it must have a … well a Target …

Add this into the project node…

<target name="test">

If you build it now it will build.  Of course, it doesn’t do anything.

What is a Target.  A target is a container for a series of Tasks.  There are a lot of tasks that are built into MSBuild.  Add this to the target node…

<message text="Hello Upward Developers">

The Message task just emits a message to the host.  Your file should look like this and it should work.

<target name="test">

<message text="Hello Upward Developers">

You can add as many Tasks to a target as you would like.


No Comments