ConfigurationErrorsException.GetFilename Method

Definition

Gets the path to the configuration file being read when this configuration exception was thrown.

Overloads

GetFilename(XmlNode)

Gets the path to the configuration file from which the internal XmlNode object was loaded when this configuration exception was thrown.

GetFilename(XmlReader)

Gets the path to the configuration file that the internal XmlReader was reading when this configuration exception was thrown.

GetFilename(XmlNode)

Source:
ConfigurationErrorsException.cs
Source:
ConfigurationErrorsException.cs
Source:
ConfigurationErrorsException.cs
Source:
ConfigurationErrorsException.cs
Source:
ConfigurationErrorsException.cs
Source:
ConfigurationErrorsException.cs

Gets the path to the configuration file from which the internal XmlNode object was loaded when this configuration exception was thrown.

C#
public static string GetFilename(System.Xml.XmlNode node);

Parameters

node
XmlNode

The XmlNode object that caused this ConfigurationErrorsException exception to be thrown.

Returns

The path to the configuration file from which the internal XmlNode object was loaded when this configuration exception was thrown.

Remarks

The GetFilename method returns the name of the configuration file that contains the XmlNode object being parsed when the exception occurred.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

GetFilename(XmlReader)

Source:
ConfigurationErrorsException.cs
Source:
ConfigurationErrorsException.cs
Source:
ConfigurationErrorsException.cs
Source:
ConfigurationErrorsException.cs
Source:
ConfigurationErrorsException.cs
Source:
ConfigurationErrorsException.cs

Gets the path to the configuration file that the internal XmlReader was reading when this configuration exception was thrown.

C#
public static string GetFilename(System.Xml.XmlReader reader);

Parameters

reader
XmlReader

The XmlReader object that caused this ConfigurationErrorsException exception to be thrown.

Returns

The path of the configuration file the internal XmlReader object was accessing when the exception occurred.

Remarks

The GetFilename method returns the name of the configuration file that the XmlReader object was accessing when the exception occurred.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10