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)

Source:
ProjectRootElement.cs

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

C#
public static Microsoft.Build.Construction.ProjectRootElement Open(string path);

Parameters

path
String

The file path to the data.

Returns

The initialized project root.

Remarks

May throw InvalidProjectFileException.

Applies to

MSBuild 17 ve diğer sürümler
Ürün Sürümler
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

Open(String, ProjectCollection)

Source:
ProjectRootElement.cs

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

C#
public static Microsoft.Build.Construction.ProjectRootElement Open(string path, Microsoft.Build.Evaluation.ProjectCollection projectCollection);

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

MSBuild 17 ve diğer sürümler
Ürün Sürümler
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

Open(String, ProjectCollection, Nullable<Boolean>)

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.

C#
public static Microsoft.Build.Construction.ProjectRootElement Open(string path, Microsoft.Build.Evaluation.ProjectCollection projectCollection, bool? preserveFormatting);

Parameters

path
String
projectCollection
ProjectCollection
preserveFormatting
Nullable<Boolean>

Returns

Applies to

MSBuild 17 ve diğer sürümler
Ürün Sürümler
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17