Partilhar via


ProjectCollection.LoadProject Method

Definition

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

Overloads

LoadProject(XmlReader, IDictionary<String,String>, String)

Loads a project with the specified reader, tools version and global properties. The project will be added to this project collection when it is named.

LoadProject(String, IDictionary<String,String>, String)

Loads a project with the specified filename, tools version and global properties. If a matching project is already loaded, it will be returned, otherwise a new project will be loaded.

LoadProject(XmlReader, String)

Loads a project with the specified reader and tools version, using the collection's global properties. The project will be added to this project collection when it is named.

LoadProject(String, String)

Loads a project with the specified filename and tools version, using the collection's global properties. If a matching project is already loaded, it will be returned, otherwise a new project will be loaded.

LoadProject(XmlReader)

Loads a project with the specified reader, using the collection's global properties and tools version. The project will be added to this project collection when it is named.

LoadProject(String)

Loads a project with the specified filename, using the collection's global properties and tools version. If a matching project is already loaded, it will be returned, otherwise a new project will be loaded.

Remarks

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

LoadProject(XmlReader, IDictionary<String,String>, String)

Source:
ProjectCollection.cs

Loads a project with the specified reader, tools version and global properties. The project will be added to this project collection when it is named.

public:
 Microsoft::Build::Evaluation::Project ^ LoadProject(System::Xml::XmlReader ^ xmlReader, System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ globalProperties, System::String ^ toolsVersion);
public Microsoft.Build.Evaluation.Project LoadProject (System.Xml.XmlReader xmlReader, System.Collections.Generic.IDictionary<string,string> globalProperties, string toolsVersion);
member this.LoadProject : System.Xml.XmlReader * System.Collections.Generic.IDictionary<string, string> * string -> Microsoft.Build.Evaluation.Project
Public Function LoadProject (xmlReader As XmlReader, globalProperties As IDictionary(Of String, String), toolsVersion As String) As Project

Parameters

xmlReader
XmlReader

Xml reader to read project from

globalProperties
IDictionary<String,String>

The global properties to use. May be null in which case the containing project collection's global properties will be used.

toolsVersion
String

The tools version. May be null.

Returns

A loaded project.

Remarks

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 Framework 4.5 and Visual Studio 12.0, you must call UnloadProject before the ProjectCollection goes out of scope.

Applies to

LoadProject(String, IDictionary<String,String>, String)

Source:
ProjectCollection.cs

Loads a project with the specified filename, tools version and global properties. If a matching project is already loaded, it will be returned, otherwise a new project will be loaded.

public:
 Microsoft::Build::Evaluation::Project ^ LoadProject(System::String ^ fileName, System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ globalProperties, System::String ^ toolsVersion);
public Microsoft.Build.Evaluation.Project LoadProject (string fileName, System.Collections.Generic.IDictionary<string,string> globalProperties, string toolsVersion);
member this.LoadProject : string * System.Collections.Generic.IDictionary<string, string> * string -> Microsoft.Build.Evaluation.Project
Public Function LoadProject (fileName As String, globalProperties As IDictionary(Of String, String), toolsVersion As String) As Project

Parameters

fileName
String

The project file to load

globalProperties
IDictionary<String,String>

The global properties to use. May be null, in which case the containing project collection's global properties will be used.

toolsVersion
String

The tools version. May be null.

Returns

A loaded project.

Remarks

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

Applies to

LoadProject(XmlReader, String)

Source:
ProjectCollection.cs

Loads a project with the specified reader and tools version, using the collection's global properties. The project will be added to this project collection when it is named.

public:
 Microsoft::Build::Evaluation::Project ^ LoadProject(System::Xml::XmlReader ^ xmlReader, System::String ^ toolsVersion);
public Microsoft.Build.Evaluation.Project LoadProject (System.Xml.XmlReader xmlReader, string toolsVersion);
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public Microsoft.Build.Evaluation.Project LoadProject (System.Xml.XmlReader xmlReader, string toolsVersion);
member this.LoadProject : System.Xml.XmlReader * string -> Microsoft.Build.Evaluation.Project
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.LoadProject : System.Xml.XmlReader * string -> Microsoft.Build.Evaluation.Project
Public Function LoadProject (xmlReader As XmlReader, toolsVersion As String) As Project

Parameters

xmlReader
XmlReader

Xml reader to read project from

toolsVersion
String

The tools version to use. May be null.

Returns

A loaded project.

Attributes

Remarks

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 Framework 4.5 and Visual Studio 12.0, you must call UnloadProject before the ProjectCollection goes out of scope.

Applies to

LoadProject(String, String)

Source:
ProjectCollection.cs

Loads a project with the specified filename and tools version, using the collection's global properties. If a matching project is already loaded, it will be returned, otherwise a new project will be loaded.

public:
 Microsoft::Build::Evaluation::Project ^ LoadProject(System::String ^ fileName, System::String ^ toolsVersion);
public Microsoft.Build.Evaluation.Project LoadProject (string fileName, string toolsVersion);
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public Microsoft.Build.Evaluation.Project LoadProject (string fileName, string toolsVersion);
member this.LoadProject : string * string -> Microsoft.Build.Evaluation.Project
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.LoadProject : string * string -> Microsoft.Build.Evaluation.Project
Public Function LoadProject (fileName As String, toolsVersion As String) As Project

Parameters

fileName
String

The project file to load

toolsVersion
String

The tools version to use. May be null.

Returns

A loaded project.

Attributes

Remarks

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

Applies to

LoadProject(XmlReader)

Source:
ProjectCollection.cs

Loads a project with the specified reader, using the collection's global properties and tools version. The project will be added to this project collection when it is named.

public:
 Microsoft::Build::Evaluation::Project ^ LoadProject(System::Xml::XmlReader ^ xmlReader);
public Microsoft.Build.Evaluation.Project LoadProject (System.Xml.XmlReader xmlReader);
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public Microsoft.Build.Evaluation.Project LoadProject (System.Xml.XmlReader xmlReader);
member this.LoadProject : System.Xml.XmlReader -> Microsoft.Build.Evaluation.Project
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.LoadProject : System.Xml.XmlReader -> Microsoft.Build.Evaluation.Project
Public Function LoadProject (xmlReader As XmlReader) As Project

Parameters

xmlReader
XmlReader

Xml reader to read project from

Returns

A loaded project.

Attributes

Remarks

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 Framework 4.5 and Visual Studio 12.0, you must call UnloadProject before the ProjectCollection goes out of scope.

Applies to

LoadProject(String)

Source:
ProjectCollection.cs

Loads a project with the specified filename, using the collection's global properties and tools version. If a matching project is already loaded, it will be returned, otherwise a new project will be loaded.

public:
 Microsoft::Build::Evaluation::Project ^ LoadProject(System::String ^ fileName);
public Microsoft.Build.Evaluation.Project LoadProject (string fileName);
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public Microsoft.Build.Evaluation.Project LoadProject (string fileName);
member this.LoadProject : string -> Microsoft.Build.Evaluation.Project
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.LoadProject : string -> Microsoft.Build.Evaluation.Project
Public Function LoadProject (fileName As String) As Project

Parameters

fileName
String

The project file to load

Returns

A loaded project.

Attributes

Remarks

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

Applies to