Project Constructor (ProjectRootElement, IDictionary<String, String>, String, String, ProjectCollection, ProjectLoadSettings)


Constructs a project and evaluates it using the given project root and with the given global properties, tools and sub-toolset versions, project collection, and load settings.

Namespace:   Microsoft.Build.Evaluation
Assembly:  Microsoft.Build (in Microsoft.Build.dll)

public Project(
	ProjectRootElement xml,
	IDictionary<string, string> globalProperties,
	string toolsVersion,
	string subToolsetVersion,
	ProjectCollection projectCollection,
	ProjectLoadSettings loadSettings


Type: Microsoft.Build.Construction.ProjectRootElement

The project root to use for evaluation.

Type: System.Collections.Generic.IDictionary<String, String>

Global properties to evaluate with. May be null in which case the containing project collection's global properties will be used.

Type: System.String

Tools version to evaluate with. May be null.

Type: System.String

Sub toolset version to evaluate with. May be null.

Type: Microsoft.Build.Evaluation.ProjectCollection

The project collection the project is added to. May not be null.

Type: Microsoft.Build.Evaluation.ProjectLoadSettings

The load settings to use for evaluation.

This project is added to the given project collection when either this project or the given project root is given the full path to the source project file.

Throws InvalidProjectFileException if the evaluation fails. Throws InvalidOperationException if there is already an equivalent project loaded in the project collection.

.NET Framework
Available since 4.5
Return to top