PropertyGroup Element (MSBuild)

PropertyGroup Element (MSBuild) 

Contains a set of user-defined Property elements. Every Property element used in an MSBuild project must be a child of a PropertyGroup element.

<PropertyGroup Condition="'String A' == 'String B'">

The following sections describe attributes, child elements, and parent elements.


Attribute Description


Optional attribute.

Condition to be evaluated. For more information, see MSBuild Conditions.

Child Elements

Element Description


Optional element.

A user defined property name, which contains the property value. There may be zero or more Property elements in a PropertyGroup element.

Parent Elements

Element Description


Required root element of an MSBuild project file.

The following code example shows how to set properties based on a condition. In this example, if the value of the CompileConfig property is DEBUG, the Optimization, Obfuscate, and OutputPath properties inside of the PropertyGroup element are set.

<PropertyGroup Condition="'$(CompileConfig)' == 'DEBUG'" >

Community Additions

© 2015 Microsoft