public class XmlException : SystemException
Object
Exception
SystemException
XmlException
System.Xml
XML
Represents the error that occurs when an XML document or fragment cannot be parsed.
System.Xml Namespace
XmlException Constructors
XmlException Properties
XmlException.LineNumber Property
XmlException.LinePosition Property
XmlException.Message Property
public XmlException(string message, Exception innerException);
Constructs and initializes a new instance of the XmlException class.
- message
- A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
- innerException
- An instance of Exception that is the cause of the current exception. If innerException is not a
null
reference, the current exception was raised in a catch block handling innerException.
This constructor initializes the System.Xml.XmlException.Message property of the new instance using message and the System.Xml.XmlException.InnerException property using innerException. If the message parameter isnull
, the System.Xml.XmlException.Message property is set to the system-supplied message provided by the constructor that takes no arguments.The System.Xml.XmlException.LineNumber and System.Xml.XmlException.LinePosition properties are initialized to zero.
[Note: For more information on inner exceptions, see System.Exception.InnerException.]
System.Xml.XmlException Class, System.Xml Namespace
public int LineNumber { get; }
Gets the line number where the error occurred.
A Int32 containing the line number where the error occurred.
This property is read-only.
System.Xml.XmlException Class, System.Xml Namespace
public int LinePosition { get; }
Gets the character position where the error occurred.
A Int32 containing the character position where the error occurred.
This property is read-only.The first character in the line is in position 1. Note that white space characters at the start of the line are not skipped.
System.Xml.XmlException Class, System.Xml Namespace
public override string Message { get; }
Gets the error message that describes the current exception.
A String containing the error message that describes the current exception.
This property is read-only.If the System.Xml.XmlException.LineNumber property is not equal to zero, the string returned by this property includes the values of the System.Xml.XmlException.LineNumber and System.Xml.XmlException.LinePosition properties.
[Note: This property overrides System.Exception.Message.]
System.Xml.XmlException Class, System.Xml Namespace