Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
MSBuild Reference
 PropertyGroup Element (MSBuild)
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework General Reference
PropertyGroup Element (MSBuild)

Updated: November 2007

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'">
    <Property1>...</Property1>
    <Property2>...</Property2>
</PropertyGroup>

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

Attributes

Attribute

Description

Condition

Optional attribute.

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

Child Elements

Element

Description

Property

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

Project

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'" >
    <Optimization>false</Optimization>
    <Obfuscate>false</Obfuscate>
    <OutputPath>$(OutputPath)\debug</OutputPath>
</PropertyGroup>
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker