Partilhar via


Project.DefaultToolsVersion Property

Definition

Public read-write accessor for the ToolsVersion xml attribute found on the <Project /> element. If this attribute is not present on the <Project/> element, getting the value will return the default tools version of the parent Engine.

NOTE: This value is distinct from the effective tools version used during a build, as that value may be overridden during construction of the Project instance or by setting the Project.ToolsVersion property. Setting this attribute value will not change the effective tools version if it has been overridden. To change the effective tools version, set the Project.ToolsVersion property.

public:
 property System::String ^ DefaultToolsVersion { System::String ^ get(); void set(System::String ^ value); };
public string DefaultToolsVersion { get; set; }
member this.DefaultToolsVersion : string with get, set
Public Property DefaultToolsVersion As String

Property Value

A string representing the Tools version.

Remarks

If the ToolsVersion attribute is not present on the Project element, getting the value returns the default Tools version of the parent Microsoft.Build.BuildEngine.

The DefaultToolsVersion value can differ from the Tools version used during a build if its value is overridden during construction of the DefaultToolsVersion instance or it is set to a specific value with the ToolsVersion property. Setting the DefaultToolsVersion value cannot change the Tools version if it has been overridden, but you can change the Tools version using the ToolsVersion property.

For more information about Tools versions, see MSBuild ToolSet (ToolsVersion).

Applies to