Extending the Build Process

MSBuild aims to expose the build process and to allow users to completely customize the process. MSBuild does indeed achieve both of these goals, and does a good job of it! We will now take a close look at that build process and see how it can be extended.

When you create a managed project using Visual Studio, toward the bottom of the project file you will find an import statement such as the following one, which was taken from a C# project.

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

This statement imports another known file that defines how C# projects are built. This project file is shipped along with MSBuild, which is delivered as a part of the .NET Framework. The contents of the project files ...

Get Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.