Default/Initial Targets

When you create an MSBuild file, you will typically create it such that a target, or a set of targets, will be executed most of the time. In this scenario, these targets can be specified as default targets. These targets will be executed if a target is not specifically chosen to be executed. Without the declaration of a default target, the first defined target in the logical project file, after all imports have been resolved, is treated as the default target. A logical project file is the project file with all Import statements processed. Using default target(s) is how Visual Studio builds your managed project. If you take a look at Visual Studio-generated project files, you will notice that the Build target is specified ...

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.