dotnet/wpf · error · NotImplementedException
The method or operation is not implemented.
Error message
The method or operation is not implemented.
What it means
FontTypeConverter.ConvertFrom ends with an unconditional 'throw new NotImplementedException()': even when the input type is supported, conversion from is not implemented in ReachFramework's font converter.
Solutions
- Bypass the converter and construct the font object (FontFamily, Typeface, GlyphRun) directly.
- Handle NotImplementedException if the converter is invoked by framework code you cannot change.
- Substitute a custom TypeConverter with a real ConvertFrom implementation.
- Refactor calling code to not rely on conversion-from for fonts.
Example fix
// before var glyphRun = (GlyphRun)converter.ConvertFrom(null, null, data); // after var glyphRun = BuildGlyphRunFromData(data); // own construction logic
Defensive patterns
Strategy: try-catch
Try / catch
try { return converter.ConvertFrom(context, culture, value); }
catch (NotImplementedException) { return ConstructFontDirectly(value); } Prevention
- Build FontFamily/Typeface/GlyphRun directly instead of via converter.
- Do not wire FontTypeConverter into XAML conversion paths.
- Provide a custom TypeConverter where conversion-from is genuinely needed.
When it happens
Trigger: Any successful path through FontTypeConverter.ConvertFrom with a value type that passes IsSupportedType.
Common situations: Indirect invocation from XAML/TypeDescriptor or serialization frameworks that honor TypeConverter contracts.
Related errors
- Cannot convert from type.
- The method or operation is not implemented.
- 0x80004001
- ArgumentException: path
- ArgumentException: relativeTo
AI-assisted analysis of dotnet/wpf@81131a70a4 (2026-09-14).
Data as JSON: /api/errors/c70d52fabc512838.
Report an issue: GitHub.
Appendix: source
Thrown at src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/FontTypeConverter.cs:109
/// <returns>
/// An Object that represents the converted value.
/// </returns>
public
override
object
ConvertFrom(
ITypeDescriptorContext context,
System.Globalization.CultureInfo culture,
object value
)
{
ArgumentNullException.ThrowIfNull(value);
if (!IsSupportedType(value.GetType()))
{
throw new NotSupportedException(SR.Converter_ConvertFromNotSupported);
}
throw new NotImplementedException();
}
/// <summary>
/// Converts the given value object to the specified type,
/// using the arguments.
/// </summary>
/// <param name="context">
/// An ITypeDescriptorContext that provides a format context.
/// </param>
/// <param name="culture">
/// A CultureInfo object. If null is passed, the current
/// culture is assumed.
/// </param>
/// <param name="value">
/// The Object to convert.
/// </param>
/// <param name="destinationType">
/// The Type to convert the value parameter to.View on GitHub (pinned to 81131a70a4)