Represents an exception that is thrown when an invalid cast occurs.
Object
Exception
SystemException
InvalidCastException
[Visual Basic] Public Class InvalidCastException Inherits SystemException [C#] public class InvalidCastException : SystemException [C++] public __gc class InvalidCastException : public SystemException [JScript] public class InvalidCastException extends SystemException
The InvalidCastException is the exception class that is thrown when a bad cast occurs.
Namespace: System
Assembly: mscorlib.dll