Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

Property Element (MSBuild) 

Contains a user defined property name and value. Every property used in an MSBuild project must be specified as a child of a PropertyGroup element.

<Property Condition="'String A' == 'String B'">
    Property Value

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


Parent Elements

Element Description


Grouping element for properties.

A text value is optional.

This text specifies the property value and may contain XML.

Property values are referenced in the project by placing the property name between "$(" and ")". For example, $(builddir)\classes would resolve to "build\classes", if the builddir property had the value build. For more information on properties, see MSBuild Properties.

The following code sets the Optimization property to false and the DefaultVersion property to 1.0 if the Version property is empty.

    <DefaultVersion Condition="'$(Version)' == ''" >1.0</DefaultVersion>
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.