Compartilhar via


MSBuild project file schema reference

Provides a table of all the MSBuild XML Schema elements with their available attributes and child elements.

MSBuild uses project files to instruct the build engine what to build and how to build it. MSBuild project files are XML files that adhere to the MSBuild XML schema. This section documents the XML schema definition (.xsd) file for MSBuild.

The schema link in an MSBuild project file is not required in Visual Studio 2017 and later. If present, it should be http://schemas.microsoft.com/developer/msbuild/2003 regardless of the version of Visual Studio.

MSBuild XML schema elements

The following table lists all of the MSBuild XML schema elements along with their child elements and attributes.

Element Child elements Attributes
Choose element (MSBuild) Otherwise

When
--
Import element (MSBuild) -- Condition

Project
ImportGroup element Import Condition
Item element (MSBuild) ItemMetaData Condition

Exclude

Include

Remove
ItemDefinitionGroup element (MSBuild) Item Condition
ItemGroup element (MSBuild) Item Condition
ItemMetadata element (MSBuild) Item Condition
OnError element (MSBuild) -- Condition

ExecuteTargets
Otherwise element (MSBuild) Choose

ItemGroup

PropertyGroup
--
Output element (MSBuild) -- Condition

ItemName

PropertyName

TaskParameter
Parameter element -- Output

ParameterType

Required
ParameterGroup element Parameter --
Project element (MSBuild) Choose

Import

ItemGroup

ProjectExtensions

PropertyGroup

Target

UsingTask
DefaultTargets

InitialTargets

Sdk

ToolsVersion

TreatAsLocalProperty

xmlns
ProjectExtensions element (MSBuild) -- --
Property element (MSBuild) -- Condition
PropertyGroup element (MSBuild) Property Condition
Sdk element (MSBuild) -- Name

Version
Target element (MSBuild) OnError

Task
AfterTargets

BeforeTargets

Condition

DependsOnTargets

Inputs

KeepDuplicateOutputs

Name

Outputs

Returns
Task element of Target (MSBuild) Output Condition

ContinueOnError

Parameter
Task element of UsingTask (MSBuild) Data Evaluate
UsingTask element (MSBuild) ParameterGroup

Task
AssemblyFile

AssemblyName

Condition

TaskFactory

TaskName
When element (MSBuild) Choose

ItemGroup

PropertyGroup
Condition

See also