dotnet/wpf · error · NotImplementedException

The method or operation is not implemented.

Error message

The method or operation is not implemented.

What it means

XpsImageSerializationService.VerifyImageSourceSerializability is an unimplemented stub that unconditionally throws NotImplementedException. The method exists on the interface but this implementation provides no functionality.

Solutions

  1. Avoid calling VerifyImageSourceSerializability; use supported serialization paths (e.g. XpsDocument writing APIs)
  2. Provide your own implementation if you control a derived/alternative service
  3. Check for an updated framework version where the method is implemented
Defensive patterns

Strategy: try-catch

Try / catch

try
{
    serializable = service.VerifyImageSourceSerializability(bitmapSource);
}
catch (NotImplementedException)
{
    // Stub API: fall back to supported serialization path
    serializable = false;
}

Prevention

When it happens

Trigger: Any call to VerifyImageSourceSerializability on this XpsImageSerializationService instance, regardless of the BitmapSource passed.

Common situations: Code paths in XPS serialization that probe whether a BitmapSource can be serialized; hitting this indicates the API surface was never implemented in ReachFramework (dead/stub API surface).

Related errors


AI-assisted analysis of dotnet/wpf@81131a70a4 (2026-09-14). Data as JSON: /api/errors/541cc5683c1a0e50. Report an issue: GitHub.

Appendix: source

Thrown at src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/XpsImageSerializationService.cs:178

        }
        
        /// <summary>
        /// This method verifies whether a given BitmapSource
        /// is serializable by this service.
        /// </summary>
        /// <param name="bitmapSource">
        /// A reference to a BitmapSource to be checked.
        /// </param>
        /// <returns>
        /// A boolean value specifing serializability.
        /// </returns>
        public
        bool
        VerifyImageSourceSerializability(
            BitmapSource bitmapSource
            )
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// This method serializes a given BitmapSource to a
        /// stream and returns a reference to the stream.
        /// </summary>
        /// <param name="bitmapSource">
        /// A reference to a BitmapSource to be serialized.
        /// </param>
        /// <returns>
        /// A reference to a Stream where BitmapSource was serialized.
        /// </returns>
        public
        Stream
        SerializeToStream(
            BitmapSource bitmapSource
            )
        {

View on GitHub (pinned to 81131a70a4)