通过


AggregateException 构造函数

定义

初始化 AggregateException 类的新实例。

重载

名称 说明
AggregateException()

使用描述错误的系统提供的消息初始化 AggregateException 类的新实例。

AggregateException(IEnumerable<Exception>)

使用对此异常原因的内部异常的引用初始化类的新实例 AggregateException

AggregateException(Exception[])

使用对此异常原因的内部异常的引用初始化类的新实例 AggregateException

AggregateException(String)

使用描述错误的指定消息初始化 AggregateException 类的新实例。

AggregateException(SerializationInfo, StreamingContext)
已过时.

使用序列化数据初始化类的新实例 AggregateException

AggregateException(String, IEnumerable<Exception>)

使用指定的错误消息初始化类的新实例 AggregateException ,并引用作为此异常原因的内部异常。

AggregateException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用初始化类的新实例 AggregateException

AggregateException(String, Exception[])

使用指定的错误消息初始化类的新实例 AggregateException ,并引用作为此异常原因的内部异常。

AggregateException()

Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs

使用描述错误的系统提供的消息初始化 AggregateException 类的新实例。

public:
 AggregateException();
public AggregateException();
Public Sub New ()

注解

此构造函数将 Message 新实例的属性初始化为描述错误的系统提供的消息,例如“System.AggregateException:发生了一个或多个错误”。此消息将考虑当前系统区域性。

下表显示了 AggregateException实例的初始属性值。

财产 价值
InnerException null
Message 本地化的错误消息字符串。

另请参阅

适用于

AggregateException(IEnumerable<Exception>)

Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs

使用对此异常原因的内部异常的引用初始化类的新实例 AggregateException

public:
 AggregateException(System::Collections::Generic::IEnumerable<Exception ^> ^ innerExceptions);
public AggregateException(System.Collections.Generic.IEnumerable<Exception> innerExceptions);
new AggregateException : seq<Exception> -> AggregateException
Public Sub New (innerExceptions As IEnumerable(Of Exception))

参数

innerExceptions
IEnumerable<Exception>

是当前异常原因的异常。

例外

参数 innerExceptions 为 null。

值为 null 的 innerExceptions 元素。

适用于

AggregateException(Exception[])

Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs

使用对此异常原因的内部异常的引用初始化类的新实例 AggregateException

public:
 AggregateException(... cli::array <Exception ^> ^ innerExceptions);
public AggregateException(params Exception[] innerExceptions);
new AggregateException : Exception[] -> AggregateException
Public Sub New (ParamArray innerExceptions As Exception())

参数

innerExceptions
Exception[]

是当前异常原因的异常。

例外

参数 innerExceptions 为 null。

值为 null 的 innerExceptions 元素。

适用于

AggregateException(String)

Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs

使用描述错误的指定消息初始化 AggregateException 类的新实例。

public:
 AggregateException(System::String ^ message);
public AggregateException(string message);
public AggregateException(string? message);
new AggregateException : string -> AggregateException
Public Sub New (message As String)

参数

message
String

描述异常的消息。 此构造函数的调用方必须确保此字符串已本地化为当前系统区域性。

注解

下表显示了 AggregateException实例的初始属性值。

财产 价值
InnerException null
Message message中指定的错误消息字符串。

另请参阅

适用于

AggregateException(SerializationInfo, StreamingContext)

Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs

注意

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

使用序列化数据初始化类的新实例 AggregateException

protected:
 AggregateException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
[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 AggregateException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected AggregateException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Security.SecurityCritical]
protected AggregateException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[<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}")>]
new AggregateException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> AggregateException
new AggregateException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> AggregateException
[<System.Security.SecurityCritical>]
new AggregateException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> AggregateException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

参数

info
SerializationInfo

保存序列化对象数据的对象。

context
StreamingContext

有关源或目标的上下文信息。

属性

例外

参数 info 为 null。

无法正确反序列化异常。

注解

在反序列化期间调用此构造函数以重新构造通过流传输的异常对象。 有关详细信息,请参阅 XML 和 SOAP 序列化

另请参阅

适用于

AggregateException(String, IEnumerable<Exception>)

Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs

使用指定的错误消息初始化类的新实例 AggregateException ,并引用作为此异常原因的内部异常。

public:
 AggregateException(System::String ^ message, System::Collections::Generic::IEnumerable<Exception ^> ^ innerExceptions);
public AggregateException(string message, System.Collections.Generic.IEnumerable<Exception> innerExceptions);
public AggregateException(string? message, System.Collections.Generic.IEnumerable<Exception> innerExceptions);
new AggregateException : string * seq<Exception> -> AggregateException
Public Sub New (message As String, innerExceptions As IEnumerable(Of Exception))

参数

message
String

说明异常原因的错误消息。

innerExceptions
IEnumerable<Exception>

是当前异常原因的异常。

例外

参数 innerExceptions 为 null。

值为 null 的 innerExceptions 元素。

适用于

AggregateException(String, Exception)

Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs

使用指定的错误消息和对作为此异常原因的内部异常的引用初始化类的新实例 AggregateException

public:
 AggregateException(System::String ^ message, Exception ^ innerException);
public AggregateException(string message, Exception innerException);
public AggregateException(string? message, Exception innerException);
new AggregateException : string * Exception -> AggregateException
Public Sub New (message As String, innerException As Exception)

参数

message
String

描述异常的消息。 此构造函数的调用方必须确保此字符串已本地化为当前系统区域性。

innerException
Exception

是当前异常原因的异常。 如果未 innerExceptionnull 参数,则会在处理内部异常的 catch 块中引发当前异常。

例外

参数 innerException 为 null。

注解

作为上一个异常的直接结果引发的异常应包括对 InnerException 属性中上一个异常的引用。 InnerException 属性返回传入构造函数的相同值,或者如果 null 属性未向构造函数提供内部异常值,则返回 InnerException

下表显示了 AggregateException实例的初始属性值。

财产 价值
InnerException null
Message message中指定的错误消息字符串。

另请参阅

适用于

AggregateException(String, Exception[])

Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs
Source:
AggregateException.cs

使用指定的错误消息初始化类的新实例 AggregateException ,并引用作为此异常原因的内部异常。

public:
 AggregateException(System::String ^ message, ... cli::array <Exception ^> ^ innerExceptions);
public AggregateException(string message, params Exception[] innerExceptions);
public AggregateException(string? message, params Exception[] innerExceptions);
new AggregateException : string * Exception[] -> AggregateException
Public Sub New (message As String, ParamArray innerExceptions As Exception())

参数

message
String

说明异常原因的错误消息。

innerExceptions
Exception[]

是当前异常原因的异常。

例外

参数 innerExceptions 为 null。

值为 null 的 innerExceptions 元素。

适用于