Initializes an instance of the TypeInitializationnException class with the given message and given root cause exception.
[Visual Basic] Public Sub New( _ ByVal fullTypeName As String, _ ByVal inner As Exception _ ) [C#] public TypeInitializationException( string fullTypeName, Exception inner ); [C++] public: TypeInitializationException( String* fullTypeName, Exception* inner ); [JScript] public function TypeInitializationException( fullTypeName : String, inner : Exception );
When handling exceptions, it is sometimes desirable to throw another exception, one which is more indicative of the error that has occurred. In order that the original exception and the information that it carries is not lost, exceptions have a field that can hold a reference to another exception.
The ErrorCode property is set to COR_E_TYPEINITIALIZATION.When handling an exception, it is sometimes helpful to have a reference to the exception(s) that caused the error to occur. You can use this constructor to create a chain of new and more meaningful exceptions with the InnerException property set to the inner exception reference. This more meaningful exception can then be thrown to the caller. Note that with this functionality it is possible to create a series of linked exceptions that terminates with the exception that was first thrown. (See Exception for more information.)
TypeInitializationException Class | TypeInitializationException Members | System Namespace