So I've spent the last few days devoting my spare time to moving the build process for the DLL that I work on (Micrsoft.VisualStudio.Publish.dll) to build with the new MSBuild rather than Build.exe (our current build system). I have to say that I love MSBuild! Here are the advantages I've seen so far:

  • My project file is much more readable. Before, our combination of sources file and makefile.inc was difficult to read unless you knew all the macros and properties and what they did. With MSBuild, I have a nice, easy to read XML file which is much easier on the eyes (and gets syntax coloring too).
  • I can use Visual Studio! I can open my project with Visual Studio, press F5, and start debugging a new VS instance with my changes built and copied to the right place. This is such a huge benefit over the old system of edit, tab to console window, type build, wait, double click VS icon, attach, repeat. All of that is now in one button and I love it.
  • I can write Unit Tests with Visual Studio. VS 2005 has great Unit test integration and now that I'm fully functional in VS I can write take advantage of all of these features. I can also use the Object Test Bench, the Class Diagram, etc. This rocks!

As you can tell, I'm very excited about this :) The conversion was easy too. The MSBuild team has a dogfood group that has written tools that automatically migrate a good chunk of your sources and makefile.inc macros to a project file. My favorite tool is BuildWatch. You point it at your directory and it builds first the old way and then the new way and lets you compare outputs. It helped me track down quite a few errors in my project file.

I think that one of the best features of MSBuild is that we've created a single format that works in VS as well as from a command line in a build lab environment. You can customize your build with your own tasks or just tweak the existing process; it's all in XML so it's nice and open. VS even guards you from malicious projects so you don't get burned when you download a project from the internet (kind of like macro protection for Office documents). This has to be one of the coolest unsung features of .Net 2.0 (the command line stuff ships with the SDK).