Name

InvalidCastException

Synopsis

This exception signals a failure during a cast or explicit conversion.

public class InvalidCastException : SystemException {
// Public Constructors
   public InvalidCastException( );
   public InvalidCastException(string message);
   public InvalidCastException(string message, Exception innerException);
// Protected Constructors
   protected InvalidCastException(System.Runtime.Serialization.SerializationInfo info,
        System.Runtime.Serialization.StreamingContext context);
}

Hierarchy

Object Exception(System.Runtime.Serialization.ISerializable) SystemException InvalidCastException

Get C# in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.