XmlSchemaException Constructors

Definition

Streams all the XmlSchemaException properties into the SerializationInfo class for the given StreamingContext.

Overloads

XmlSchemaException()

Initializes a new instance of the XmlSchemaException class.

XmlSchemaException(String)

Initializes a new instance of the XmlSchemaException class with the exception message specified.

XmlSchemaException(SerializationInfo, StreamingContext)
Obsolete.

Constructs a new XmlSchemaException object with the given SerializationInfo and StreamingContext information that contains all the properties of the XmlSchemaException.

XmlSchemaException(String, Exception)

Initializes a new instance of the XmlSchemaException class with the exception message and original Exception object that caused this exception specified.

XmlSchemaException(String, Exception, Int32, Int32)

Initializes a new instance of the XmlSchemaException class with the exception message specified, and the original Exception object, line number, and line position of the XML that cause this exception specified.

XmlSchemaException()

Source:
XmlSchemaException.cs
Source:
XmlSchemaException.cs
Source:
XmlSchemaException.cs

Initializes a new instance of the XmlSchemaException class.

C#
public XmlSchemaException();

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.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, 2.1

XmlSchemaException(String)

Source:
XmlSchemaException.cs
Source:
XmlSchemaException.cs
Source:
XmlSchemaException.cs

Initializes a new instance of the XmlSchemaException class with the exception message specified.

C#
public XmlSchemaException(string? message);
C#
public XmlSchemaException(string message);

Parameters

message
String

A string description of the error condition.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.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, 2.1

XmlSchemaException(SerializationInfo, StreamingContext)

Source:
XmlSchemaException.cs
Source:
XmlSchemaException.cs
Source:
XmlSchemaException.cs

Caution

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Constructs a new XmlSchemaException object with the given SerializationInfo and StreamingContext information that contains all the properties of the XmlSchemaException.

C#
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected XmlSchemaException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
C#
protected XmlSchemaException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);

Parameters

info
SerializationInfo

SerializationInfo.

context
StreamingContext

StreamingContext.

Attributes

Applies to

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8, 9, 10)
.NET Framework 1.1, 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, 2.1

XmlSchemaException(String, Exception)

Source:
XmlSchemaException.cs
Source:
XmlSchemaException.cs
Source:
XmlSchemaException.cs

Initializes a new instance of the XmlSchemaException class with the exception message and original Exception object that caused this exception specified.

C#
public XmlSchemaException(string? message, Exception? innerException);
C#
public XmlSchemaException(string message, Exception innerException);

Parameters

message
String

A string description of the error condition.

innerException
Exception

The original Exception object that caused this exception.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 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, 2.1

XmlSchemaException(String, Exception, Int32, Int32)

Source:
XmlSchemaException.cs
Source:
XmlSchemaException.cs
Source:
XmlSchemaException.cs

Initializes a new instance of the XmlSchemaException class with the exception message specified, and the original Exception object, line number, and line position of the XML that cause this exception specified.

C#
public XmlSchemaException(string? message, Exception? innerException, int lineNumber, int linePosition);
C#
public XmlSchemaException(string message, Exception innerException, int lineNumber, int linePosition);

Parameters

message
String

A string description of the error condition.

innerException
Exception

The original Exception object that caused this exception.

lineNumber
Int32

The line number of the XML that caused this exception.

linePosition
Int32

The line position of the XML that caused this exception.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.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, 2.1