Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ProjectRootElement.Open Method

Definition

Namespace:
Microsoft.Build.Construction
Assembly:
Microsoft.Build.dll
Package:
Microsoft.Build v15.9.20
Package:
Microsoft.Build v16.11.0
Package:
Microsoft.Build v17.14.8
Package:
Microsoft.Build v18.3.3
Package:
Microsoft.Build v18.4.0

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Initializes a project root in the global project collection by loading data from the specified file path.

Overloads

Name Description
Open(String)

Initialize a ProjectRootElement instance by loading from the specified file path. Uses the global project collection. May throw InvalidProjectFileException.

Open(String, ProjectCollection)

Initialize a ProjectRootElement instance by loading from the specified file path. Uses the specified project collection. May throw InvalidProjectFileException.

Open(String, ProjectCollection, Nullable<Boolean>)

Initialize a ProjectRootElement instance by loading from the specified file path. Uses the specified project collection and preserves the formatting of the document if specified.

Open(String)

Source:
ProjectRootElement.cs
Source:
ProjectRootElement.cs
Source:
ProjectRootElement.cs

Initialize a ProjectRootElement instance by loading from the specified file path. Uses the global project collection. May throw InvalidProjectFileException.

public:
 static Microsoft::Build::Construction::ProjectRootElement ^ Open(System::String ^ path);
public static Microsoft.Build.Construction.ProjectRootElement Open(string path);
static member Open : string -> Microsoft.Build.Construction.ProjectRootElement
Public Shared Function Open (path As String) As ProjectRootElement

Parameters

path
String

The file path to the data.

Returns

The initialized project root.

Remarks

May throw InvalidProjectFileException.

Applies to

Open(String, ProjectCollection)

Source:
ProjectRootElement.cs
Source:
ProjectRootElement.cs
Source:
ProjectRootElement.cs

Initialize a ProjectRootElement instance by loading from the specified file path. Uses the specified project collection. May throw InvalidProjectFileException.

public:
 static Microsoft::Build::Construction::ProjectRootElement ^ Open(System::String ^ path, Microsoft::Build::Evaluation::ProjectCollection ^ projectCollection);
public static Microsoft.Build.Construction.ProjectRootElement Open(string path, Microsoft.Build.Evaluation.ProjectCollection projectCollection);
static member Open : string * Microsoft.Build.Evaluation.ProjectCollection -> Microsoft.Build.Construction.ProjectRootElement
Public Shared Function Open (path As String, projectCollection As ProjectCollection) As ProjectRootElement

Parameters

path
String

The file path to the data.

projectCollection
ProjectCollection

The project collection containing the project to be initialized.

Returns

The initialized project root.

Remarks

May throw InvalidProjectFileException.

Applies to

Open(String, ProjectCollection, Nullable<Boolean>)

Source:
ProjectRootElement.cs
Source:
ProjectRootElement.cs
Source:
ProjectRootElement.cs

Initialize a ProjectRootElement instance by loading from the specified file path. Uses the specified project collection and preserves the formatting of the document if specified.

public:
 static Microsoft::Build::Construction::ProjectRootElement ^ Open(System::String ^ path, Microsoft::Build::Evaluation::ProjectCollection ^ projectCollection, Nullable<bool> preserveFormatting);
public static Microsoft.Build.Construction.ProjectRootElement Open(string path, Microsoft.Build.Evaluation.ProjectCollection projectCollection, bool? preserveFormatting);
static member Open : string * Microsoft.Build.Evaluation.ProjectCollection * Nullable<bool> -> Microsoft.Build.Construction.ProjectRootElement
Public Shared Function Open (path As String, projectCollection As ProjectCollection, preserveFormatting As Nullable(Of Boolean)) As ProjectRootElement

Parameters

path
String
projectCollection
ProjectCollection
preserveFormatting
Nullable<Boolean>

Returns

Applies to