• Runs build processes to build apps.
  • Used by Visual Studio to build.
  • Used by dotnet build to build.

Project (.proj) Files

  • XML-based


Key-value pairs used to configure builds.

Always inside a <PropertyGroup> tag:



<SomeProperty Condition="condition">DefaultValue</SomeProperty>


Inputs into the build system; usually files.

  • Grouped into item types based on user-defined item names.
  • Item types are used in tasks which use the individual items to perform the steps of the build process.

An item type named Compile that includes two files:

    <Compile Include = "file1.cs"/>
    <Compile Include = "file2.cs"/>

Referencing Item Types

Use @(ItemType)


Executable code that MSBuild projects use to perform build operations.

  • Can be re-used
  • Can be shared across projects

Tasks are children of a Target element. They accept parameters which are passed as attributes to the element:

<Target Name="SomeTask">
    <TaskAction TaskParameter="value" />

Properties and Items can both be used as parameters to Tasks.

Common (Built-in) Tasks

Several tasks, like MakeDir, are built in.

<Target Name="MakeBuildDirectory">
    <MakeDir Directories="$(BuildDir)" />


Targets group tasks together in a sequence and expose sections of the project file as entry points into the build process.

Logging for MSBuild