Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (58 sloc) 2.41 KB
title ms.date ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid author ms.author manager ms.workload
PropertyGroup Element (MSBuild) | Microsoft Docs
03/13/2017
reference
VB
CSharp
C++
jsharp
<PropertyGroup> element [MSBuild]
PropertyGroup element [MSBuild]
ff1e6c68-b9a1-4263-a1ce-dc3b829a64d4
mikejo5000
mikejo
jillfra
multiple

PropertyGroup element (MSBuild)

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

<Project> <PropertyGroup>

Syntax

<PropertyGroup Condition="'String A' == 'String B'">
    <Property1>...</Property1>
    <Property2>...</Property2>
</PropertyGroup>

Attributes and elements

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

Attributes

Attribute Description
Condition Optional attribute.

Condition to be evaluated. For more information, see 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 [!INCLUDEvstecmsbuild] project file.

Example

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>

See also

You can’t perform that action at this time.