XmlSchemaException 构造函数

定义

对于给定的 XmlSchemaException,将所有的 SerializationInfo 属性流式写入 StreamingContext 类。

重载

XmlSchemaException()

初始化 XmlSchemaException 类的新实例。

XmlSchemaException(String)

用指定的异常消息初始化 XmlSchemaException 类的新实例。

XmlSchemaException(SerializationInfo, StreamingContext)
已过时.

用包含 XmlSchemaException 所有属性的给定的 SerializationInfoStreamingContext 信息构造新的 XmlSchemaException 对象。

XmlSchemaException(String, Exception)

使用异常消息和导致此指定的异常的原始 XmlSchemaException 对象初始化 Exception 类的新实例。

XmlSchemaException(String, Exception, Int32, Int32)

使用指定的异常消息和导致此指定异常的原始 XmlSchemaException 对象、XML 的行号和行位置初始化 Exception 类的新实例。

XmlSchemaException()

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

初始化 XmlSchemaException 类的新实例。

C#
public XmlSchemaException ();

适用于

.NET 9 和其他版本
产品 版本
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.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

用指定的异常消息初始化 XmlSchemaException 类的新实例。

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

参数

message
String

关于错误情况的 string 说明。

适用于

.NET 9 和其他版本
产品 版本
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.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

注意

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

用包含 XmlSchemaException 所有属性的给定的 SerializationInfoStreamingContext 信息构造新的 XmlSchemaException 对象。

C#
protected XmlSchemaException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
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);

参数

info
SerializationInfo

SerializationInfo。

context
StreamingContext

StreamingContext。

属性

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8, 9)
.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

使用异常消息和导致此指定的异常的原始 XmlSchemaException 对象初始化 Exception 类的新实例。

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

参数

message
String

关于错误情况的 string 说明。

innerException
Exception

导致该异常的原始 Exception 对象。

适用于

.NET 9 和其他版本
产品 版本
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.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

使用指定的异常消息和导致此指定异常的原始 XmlSchemaException 对象、XML 的行号和行位置初始化 Exception 类的新实例。

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

参数

message
String

关于错误情况的 string 说明。

innerException
Exception

导致该异常的原始 Exception 对象。

lineNumber
Int32

导致该异常的 XML 行号。

linePosition
Int32

导致此异常的 XML 的行位置。

适用于

.NET 9 和其他版本
产品 版本
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.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