ProjectRootElement.Save Method

Definition

Saves the project, if modified, to the file system.

Overloads

Save()

Save the project to the file system, if dirty. Uses the Encoding returned by the Encoding property. Creates any necessary directories. May throw IO-related exceptions. Clears the dirty flag.

Save(TextWriter)

Save the project to the provided TextWriter, whether or not it is dirty. Uses the encoding of the TextWriter. Clears the Dirty flag.

Save(String)

Save the project to the file system, if dirty or the path is different. Creates any necessary directories. May throw IO related exceptions. Clears the Dirty flag.

Save(Encoding)

Save the project to the file system, if dirty. Creates any necessary directories. May throw IO-related exceptions. Clears the dirty flag.

Save(String, Encoding)

Save the project to the file system, if dirty or the path is different. Creates any necessary directories. May throw IO related exceptions. Clears the Dirty flag.

Save()

Source:
ProjectRootElement.cs

Save the project to the file system, if dirty. Uses the Encoding returned by the Encoding property. Creates any necessary directories. May throw IO-related exceptions. Clears the dirty flag.

C#
public void Save();

Remarks

Uses the character Encoding returned by the Encoding property. Marks the project as unmodified.

Applies to

MSBuild 17 およびその他のバージョン
製品 バージョン
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

Save(TextWriter)

Source:
ProjectRootElement.cs

Save the project to the provided TextWriter, whether or not it is dirty. Uses the encoding of the TextWriter. Clears the Dirty flag.

C#
public void Save(System.IO.TextWriter writer);

Parameters

writer
TextWriter

The text writer to write the project to.

Remarks

Uses the character encoding of the TextWriter. Marks the project as unmodified.

Applies to

MSBuild 17 およびその他のバージョン
製品 バージョン
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

Save(String)

Source:
ProjectRootElement.cs

Save the project to the file system, if dirty or the path is different. Creates any necessary directories. May throw IO related exceptions. Clears the Dirty flag.

C#
public void Save(string path);

Parameters

path
String

The file path to the project in storage.

Remarks

Marks the project as unmodified.

Applies to

MSBuild 17 およびその他のバージョン
製品 バージョン
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

Save(Encoding)

Source:
ProjectRootElement.cs

Save the project to the file system, if dirty. Creates any necessary directories. May throw IO-related exceptions. Clears the dirty flag.

C#
public void Save(System.Text.Encoding saveEncoding);

Parameters

saveEncoding
Encoding

The character encoding used to save the project.

Remarks

Marks the project as unmodified.

Applies to

MSBuild 17 およびその他のバージョン
製品 バージョン
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

Save(String, Encoding)

Source:
ProjectRootElement.cs

Save the project to the file system, if dirty or the path is different. Creates any necessary directories. May throw IO related exceptions. Clears the Dirty flag.

C#
public void Save(string path, System.Text.Encoding encoding);

Parameters

path
String

The file path to the project in storage.

encoding
Encoding

The character encoding used to save the project.

Remarks

Marks the project as unmodified.

Applies to

MSBuild 17 およびその他のバージョン
製品 バージョン
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17