26 references to InvalidCast_FromTo
System.Private.CoreLib (26)
src\libraries\System.Private.CoreLib\src\System\Boolean.cs (2)
338throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Boolean", "Char")); 398throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Boolean", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
249throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Byte", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\Char.cs (5)
519throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Boolean")); 569throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Single")); 574throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Double")); 579throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Decimal")); 584throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\Convert.cs (1)
219throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, value.GetType().FullName, targetType.FullName));
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (1)
2007private static InvalidCastException InvalidCast(string to) => new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, nameof(DateTime), to));
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (2)
1041throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Decimal", "Char")); 1101throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Decimal", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\Double.cs (2)
459throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Double", "Char")); 519throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Double", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
2192DateTime IConvertible.ToDateTime(IFormatProvider? provider) => throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Enum", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
252throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int16", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
261throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int32", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
258throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int64", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
255throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "SByte", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\Single.cs (2)
454throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Single", "Char")); 514throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Single", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
246throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt16", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
256throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt32", "DateTime"));
src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
255throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt64", "DateTime"));
src\System\Runtime\InteropServices\DynamicInterfaceCastableHelpers.cs (2)
20throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, castable.GetType(), interfaceType)); 30throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, castable.GetType(), interfaceType));