Partager via


Project.SetProperty Method

Definition

Sets the value of the specified property.

Overloads

SetProperty(String, String)

Sets (or adds) a property to the project at a sensible location.

SetProperty(String, String, String)

This method is called from the IDE to set a particular property at the project level. The IDE doesn't care which property group it's in, as long as it gets set. This method will search the existing property groups for a property with this name. If found, it will change the value in place. Otherwise, it will either add a new property to that property group, or possibly even add a new property group to the project.

This method also takes the "Condition" string for the property group that the IDE wants this property placed under.

SetProperty(String, String, String, PropertyPosition)

Set a property at a particular position inside the project file. The property will be in a group that has the specified condition. If necessary, a new property or property group will be created.

SetProperty(String, String, String, PropertyPosition, Boolean)

Sets a property, and optionally escapes it so that it will be treated as a literal value despite any special characters that may be in it.

SetProperty(String, String)

Source:
Project.cs

Sets (or adds) a property to the project at a sensible location.

public:
 void SetProperty(System::String ^ propertyName, System::String ^ propertyValue);
public void SetProperty (string propertyName, string propertyValue);
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public void SetProperty (string propertyName, string propertyValue);
member this.SetProperty : string * string -> unit
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.SetProperty : string * string -> unit
Public Sub SetProperty (propertyName As String, propertyValue As String)

Parameters

propertyName
String
propertyValue
String
Attributes

Applies to

SetProperty(String, String, String)

Source:
Project.cs

This method is called from the IDE to set a particular property at the project level. The IDE doesn't care which property group it's in, as long as it gets set. This method will search the existing property groups for a property with this name. If found, it will change the value in place. Otherwise, it will either add a new property to that property group, or possibly even add a new property group to the project.

This method also takes the "Condition" string for the property group that the IDE wants this property placed under.

public:
 void SetProperty(System::String ^ propertyName, System::String ^ propertyValue, System::String ^ condition);
public void SetProperty (string propertyName, string propertyValue, string condition);
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public void SetProperty (string propertyName, string propertyValue, string condition);
member this.SetProperty : string * string * string -> unit
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.SetProperty : string * string * string -> unit
Public Sub SetProperty (propertyName As String, propertyValue As String, condition As String)

Parameters

propertyName
String
propertyValue
String
condition
String
Attributes

Applies to

SetProperty(String, String, String, PropertyPosition)

Source:
Project.cs

Set a property at a particular position inside the project file. The property will be in a group that has the specified condition. If necessary, a new property or property group will be created.

public:
 void SetProperty(System::String ^ propertyName, System::String ^ propertyValue, System::String ^ condition, Microsoft::Build::BuildEngine::PropertyPosition position);
public void SetProperty (string propertyName, string propertyValue, string condition, Microsoft.Build.BuildEngine.PropertyPosition position);
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public void SetProperty (string propertyName, string propertyValue, string condition, Microsoft.Build.BuildEngine.PropertyPosition position);
member this.SetProperty : string * string * string * Microsoft.Build.BuildEngine.PropertyPosition -> unit
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.SetProperty : string * string * string * Microsoft.Build.BuildEngine.PropertyPosition -> unit
Public Sub SetProperty (propertyName As String, propertyValue As String, condition As String, position As PropertyPosition)

Parameters

propertyName
String

Property name.

propertyValue
String

Property value.

condition
String

The condition for this property.

position
PropertyPosition

Specifies the position within the project file for the property.

Attributes

Remarks

SetProperty is called from the integrated development environment (IDE) to set a particular property at the project level. This method searches the existing property groups for a property with this name. If one is found, it changes its value. Otherwise, it either adds a new property to that property group, or adds a new property group to the project. SetProperty uses the condition parameter to determine the name of the property group place it in.

Applies to

SetProperty(String, String, String, PropertyPosition, Boolean)

Source:
Project.cs

Sets a property, and optionally escapes it so that it will be treated as a literal value despite any special characters that may be in it.

public:
 void SetProperty(System::String ^ propertyName, System::String ^ propertyValue, System::String ^ condition, Microsoft::Build::BuildEngine::PropertyPosition position, bool treatPropertyValueAsLiteral);
public void SetProperty (string propertyName, string propertyValue, string condition, Microsoft.Build.BuildEngine.PropertyPosition position, bool treatPropertyValueAsLiteral);
member this.SetProperty : string * string * string * Microsoft.Build.BuildEngine.PropertyPosition * bool -> unit
Public Sub SetProperty (propertyName As String, propertyValue As String, condition As String, position As PropertyPosition, treatPropertyValueAsLiteral As Boolean)

Parameters

propertyName
String
propertyValue
String
condition
String
position
PropertyPosition
treatPropertyValueAsLiteral
Boolean

Applies to