Retrieves messages when type-loading failures occur.
Object
Exception
SystemException
TypeLoadException
[Visual Basic] Public Class TypeLoadException Inherits SystemException [C#] public class TypeLoadException : SystemException [C++] public __gc class TypeLoadException : public SystemException [JScript] public class TypeLoadException extends SystemException
TypeLoadException is the exception class for type loading failures.
TypeLoadExceptions are thrown when the method that calls the type in question is jitted and the runtime cannot load the type. To catch any exception, the calling method must be enclosed in a try-catch block. However, when the method being jitted is Main(), there can be no outer block, and therefore there is no way to catch the TypeLoadException.
Namespace: System
Assembly: mscorlib.dll