Export (0) Print
Expand All

ProjectCollection.LoadProject Method (XmlReader, String)

.NET Framework 4.6 and 4.5

Evaluates a project from the source code read from the given XML reader. The source code is evaluated with the global properties of this project collection and the given tools version.

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

public Project LoadProject(
	XmlReader xmlReader,
	string toolsVersion
)

Parameters

xmlReader
Type: System.Xml.XmlReader

Xml reader to read project source code from.

toolsVersion
Type: System.String

The tools version to use. May be null.

Return Value

Type: Microsoft.Build.Evaluation.Project
Returns the new project.

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

In the MSBuild versions that were delivered with .Net 4.5 and Visual Studio 12.0, you must call UnloadProject before the ProjectCollection goes out of scope.

.NET Framework

Supported in: 4.6, 4.5, 4
Show:
© 2015 Microsoft