25 references to InvalidCast_FromTo
System.Private.CoreLib (25)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Boolean.cs (2)
333throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Boolean", "Char")); 393throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Boolean", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
243throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Byte", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (5)
586throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Boolean")); 636throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Single")); 641throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Double")); 646throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Decimal")); 651throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Convert.cs (1)
218throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, value.GetType().FullName, targetType.FullName));
src\runtime\src\libraries\System.Private.CoreLib\src\System\DateTime.cs (1)
1964private static InvalidCastException InvalidCast(string to) => new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, nameof(DateTime), to));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (2)
1036throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Decimal", "Char")); 1096throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Decimal", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (2)
457throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Double", "Char")); 517throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Double", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
2191DateTime IConvertible.ToDateTime(IFormatProvider? provider) => throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Enum", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
246throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int16", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
261throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int32", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
258throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int64", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
249throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "SByte", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (2)
450throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Single", "Char")); 510throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Single", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
240throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt16", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
256throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt32", "DateTime"));
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
255throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt64", "DateTime"));
System\Runtime\InteropServices\IDynamicInterfaceCastable.cs (1)
62throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, instance.GetType(), Type.GetTypeFromMethodTable(interfaceType)));