CustomAttributeFormatException 构造函数

定义

初始化 CustomAttributeFormatException 类的新实例。

重载

名称 说明
CustomAttributeFormatException()

使用默认属性初始化 CustomAttributeFormatException 类的新实例。

CustomAttributeFormatException(String)

使用指定的消息初始化类的新实例 CustomAttributeFormatException

CustomAttributeFormatException(SerializationInfo, StreamingContext)
已过时.

使用指定的序列化和上下文信息初始化 CustomAttributeFormatException 类的新实例。

CustomAttributeFormatException(String, Exception)

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

CustomAttributeFormatException()

Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs

使用默认属性初始化 CustomAttributeFormatException 类的新实例。

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

注解

此构造函数使用空消息字符串初始化 CustomAttributeFormatException 实例,并将根本原因异常设置为 null

此构造函数按如下所示设置 Exception 对象的属性:

财产 价值
InnerException null
Message 空字符串(“)。

适用于

CustomAttributeFormatException(String)

Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs

使用指定的消息初始化类的新实例 CustomAttributeFormatException

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

参数

message
String

指示引发此异常的原因的消息。

注解

此构造函数设置 Exception 对象的属性,如下所示:

财产 价值
InnerException null

另请参阅

适用于

CustomAttributeFormatException(SerializationInfo, StreamingContext)

Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs

注意

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

使用指定的序列化和上下文信息初始化 CustomAttributeFormatException 类的新实例。

protected:
 CustomAttributeFormatException(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 CustomAttributeFormatException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected CustomAttributeFormatException(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 System.Reflection.CustomAttributeFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Reflection.CustomAttributeFormatException
new System.Reflection.CustomAttributeFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Reflection.CustomAttributeFormatException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

参数

info
SerializationInfo

用于序列化或反序列化自定义属性的数据。

context
StreamingContext

自定义属性的源和目标。

属性

适用于

CustomAttributeFormatException(String, Exception)

Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs
Source:
CustomAttributeFormatException.cs

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

public:
 CustomAttributeFormatException(System::String ^ message, Exception ^ inner);
public CustomAttributeFormatException(string? message, Exception? inner);
public CustomAttributeFormatException(string message, Exception inner);
new System.Reflection.CustomAttributeFormatException : string * Exception -> System.Reflection.CustomAttributeFormatException
Public Sub New (message As String, inner As Exception)

参数

message
String

解释异常原因的错误消息。

inner
Exception

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

注解

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

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

财产 价值
InnerException 异常 inner
Message 错误消息字符串。

另请参阅

适用于