ProjectRootElement.Open Method

Definition

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

Overloads

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)

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)

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>)

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