MSBuild is Microsoft's technology to "build" software solutions and it's new in Microsoft .NET Framework 2.0 and Visual Basic 2005. Microsoft describes MSBuild as a new build "platform" and that's a good word to use to describe it because MSBuild can be used as a solid foundation for all kinds of new software ideas. It's far more than just compiling and linking now. MSBuild is a full member of a software developer's toolkit that you can use to create your own software.
Like a lot of new ideas, MSBuild is built on a solid foundation too: XML. If XML is still a blank for you, your first job is to get a good understanding of how that works. In this article, I assume that you understand XML concepts.
MSBuild is not a new idea in the world, however. It's been said that Microsoft never invented anything but they do make the things that other people invent really work. MSBuild is a great example because it's very similar to an open source programming language called Ant. NAnt is another open source language which used the .NET Framework (the name means Not Ant).
Don't think of MSBuild as only a replacement for the build technology in Visual Studio, but rather as a whole new dimension of programming that you have available to you in VB.NET 2005. The primary use of MSBuild is to construct the output assemblies in Visual Studio 2005, however. The old "build" in VB.NET 2003 is basically the same idea that has been used for decades. The compiler, VBC.EXE, is called and reads parameters from files to determine build options. For example, here are a few of the parameters in a VB.NET 2003 ".vbproj" file:
<Build>
<Settings
OutputType = "WinExe"
OptionCompare = "Binary"
OptionExplicit = "On"
OptionStrict = "Off"
RootNamespace = "WindowsApplication1"
StartupObject = "WindowsApplication1.Form1"
>
Building a VB.NET solution this way is basically the same idea that has been used since compiles were done in a DOS box at the command line. (And you can still do it that way if you choose to.) The main improvement is that the parameter files are now coded using XML. The main disadvantage of the old VB.NET 2003 build technology is that the process couldn't be changed very much. Beyond changing the values of the parameters, there really wasn't that much you could do customize the build.
In VB.NET 2005, everything has changed - and you can change everything. Here's a small section out of a ".vbproj" file in that environment:
<ItemGroup>
<Compile Include="Form1.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.vb">
<DependentUpon>Form1.vb</DependentUpon>
<SubType>Form</SubType>
</Compile>
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
The entire ".vbproj" file is much bigger (in both VB.NET 2003 and 2005). If you still have VB.NET 2003 or earlier, you can view the .vbproj file using Notepad. But VB.NET 2005 has added a new editing capability to go along with a new build programming language. To view or edit the new .vbproj file in Visual Studio 2005 (but not in Visual Studio 2005 Express), right-click on the project in Solution Explorer, select Unload Project, and then right-click again to edit the .vbproj file. This feature isn't available in Visual Studio 2003 because it doesn't support MSBuild. You might want to try this just to get a preview of what else is in the .vbproj file. The section I selected above is an ItemGroup element containing Compile tags because they start to show how XML has been transformed from a parameter list into a dynamic build platform.
If you don't have Visual Studio 2005, you can still use Notepad since XML is just text.

