ProjectRootElement.AddProperty(String, String) Method

Definition

Convenience method that picks a location based on a heuristic. Updates the last existing property with the specified name that has no condition on itself or its property group, if any. Otherwise, adds a new property in the first property group without a condition, creating a property group if necessary after the last existing property group, else at the start of the project.

public:
 Microsoft::Build::Construction::ProjectPropertyElement ^ AddProperty(System::String ^ name, System::String ^ value);
public Microsoft.Build.Construction.ProjectPropertyElement AddProperty (string name, string value);
member this.AddProperty : string * string -> Microsoft.Build.Construction.ProjectPropertyElement
Public Function AddProperty (name As String, value As String) As ProjectPropertyElement

Parameters

name
String

The name of the property to be updated or added.

value
String

The value of the property to be updated or added.

Returns

The updated or added property.

Remarks

Updates the last existing property with the specified name that has no Condition attribute on itself or on the property group that contains it. Otherwise, creates a property and adds it to the first property group that has no Condition attribute. If no such property group exists, creates a property group after the last existing property group, if any, and adds the property to it . Otherwise, creates and adds a property group to the start of the project, and adds the property to it.

Applies to