ProjectRootElement.ReloadFrom Method
Definition
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.
Overloads
ReloadFrom(String, Boolean, Nullable<Boolean>) |
Reload the existing project root element from the given path An InvalidOperationException is thrown if the path does not exist. |
ReloadFrom(XmlReader, Boolean, Nullable<Boolean>) |
Reload the existing project root element from the given If the new state has invalid XML or MSBuild syntax, then this method throws an InvalidProjectFileException. When this happens, the state of this object does not change. Reloading from an XMLReader will retain the previous root element location (FullPath, DirectoryPath, ProjectFileLocation). |
ReloadFrom(String, Boolean, Nullable<Boolean>)
- Source:
- ProjectRootElement.cs
Reload the existing project root element from the given path An InvalidOperationException is thrown if the path does not exist.
public void ReloadFrom (string path, bool throwIfUnsavedChanges = true, bool? preserveFormatting = default);
member this.ReloadFrom : string * bool * Nullable<bool> -> unit
Public Sub ReloadFrom (path As String, Optional throwIfUnsavedChanges As Boolean = true, Optional preserveFormatting As Nullable(Of Boolean) = Nothing)
Parameters
- path
- String
- throwIfUnsavedChanges
- Boolean
Applies to
ReloadFrom(XmlReader, Boolean, Nullable<Boolean>)
- Source:
- ProjectRootElement.cs
Reload the existing project root element from the given reader
A reload operation completely replaces the state of this ProjectRootElement object. This operation marks the
object as dirty.
If the new state has invalid XML or MSBuild syntax, then this method throws an InvalidProjectFileException. When this happens, the state of this object does not change.
Reloading from an XMLReader will retain the previous root element location (FullPath, DirectoryPath, ProjectFileLocation).
public void ReloadFrom (System.Xml.XmlReader reader, bool throwIfUnsavedChanges = true, bool? preserveFormatting = default);
member this.ReloadFrom : System.Xml.XmlReader * bool * Nullable<bool> -> unit
Public Sub ReloadFrom (reader As XmlReader, Optional throwIfUnsavedChanges As Boolean = true, Optional preserveFormatting As Nullable(Of Boolean) = Nothing)
Parameters
- reader
- XmlReader
Reader to read from
- throwIfUnsavedChanges
- Boolean
If set to false, the reload operation will discard any unsaved changes. Otherwise, an InvalidOperationException is thrown when unsaved changes are present.
Whether the reload should preserve formatting or not. A null value causes the reload to reuse the existing PreserveFormatting value.