0 out of 1 rated this helpful - Rate this topic

Project.SetProperty Method

Sets or adds a property with the given name and value to the project. Overwrites the value of a property with the same name if it did not originate in an imported file.

Namespace:  Microsoft.Build.Evaluation
Assembly:  Microsoft.Build (in Microsoft.Build.dll)
public ProjectProperty SetProperty(
	string name,
	string unevaluatedValue
)

Parameters

name
Type: System.String
The name of the property to set.
unevaluatedValue
Type: System.String
The new unevaluated value of the property.

Return Value

Type: Microsoft.Build.Evaluation.ProjectProperty
Returns the property.

If there is no property with the given name, updates the last existing property with the given name that has no condition on itself or its property group, unless it originated in an imported file.

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.

Evaluation takes place on a best-effort basis. Properties that are defined in the project source following the new property may be used for evaluation. Only this property is evaluated. Other properties that might depend on it are not affected.

.NET Framework

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ