TypeInitializationException(String, Exception) TypeInitializationException(String, Exception) TypeInitializationException(String, Exception) TypeInitializationException(String, Exception) Constructor

定义

用默认错误消息、指定的类型名称和对内部异常(为该异常的根源)的引用来初始化 TypeInitializationException 类的新实例。Initializes a new instance of the TypeInitializationException class with the default error message, the specified type name, and a reference to the inner exception that is the root cause of this exception.

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

参数

fullTypeName
String String String String

未能初始化类型的完全限定名。The fully qualified name of the type that fails to initialize.

innerException
Exception Exception Exception Exception

导致当前异常的异常。The exception that is the cause of the current exception. 如果 innerException 参数不是 null 引用(在 Visual Basic 中为 Nothing),则在处理内部异常的 catch 块中引发当前异常。If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception.

注解

因前一个异常而直接引发的异常可以在 InnerException 属性中包含对前一个异常的引用。An exception that is thrown as a direct result of a previous exception can include a reference to the previous exception in the InnerException property. InnerException 属性返回传递到构造函数中的相同值,或者如果 Nothing 属性不向构造函数提供内部异常值,则为空引用(在 Visual Basic 中为 InnerException)。The InnerException property returns the same value that is passed into the constructor, or a null reference (Nothing in Visual Basic) if the InnerException property does not supply the inner exception value to the constructor.

下表显示 TypeInitializationException 的实例的初始属性值。The following table shows the initial property values for an instance of TypeInitializationException.

PropertyProperty “值”Value
InnerException 内部异常引用。The inner exception reference.
Message 本地化的错误消息字符串。The localized error message string.
TypeName 类型的名称。The name of the type.

适用于

另请参阅