dotnet/wpf · error · XpsSerializationException

SR.ReachSerialization_NoSerializer

Error message

SR.ReachSerialization_NoSerializer

What it means

ReachFixedPageSerializer.SerializePageAsVisual throws XpsSerializationException (ReachSerialization_NoSerializer) when it asks the serialization manager for a serializer to render the FixedPage as a disguised visual and none is returned. This path is used when a page is serialized as a visual rather than as markup, so a missing serializer means the visual cannot be emitted.

Solutions

  1. Ensure the page/visual type has a registered serializer in the XpsSerializationManager
  2. Use standard FixedPage/visual types so the built-in serializer resolves
  3. Catch XpsSerializationException around the write and log the visual's type
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify the visual type is a built-in serialized type before writing
bool supported = page is System.Windows.Documents.FixedPage;

Type guard

static bool IsFixedPage(object o) => o is System.Windows.Documents.FixedPage;

Try / catch

try { writer.Write(page); } catch (System.Windows.Xps.XpsSerializationException ex) { log.Error("No serializer for page visual: " + page.GetType(), ex); throw; }

Prevention

When it happens

Trigger: PersistObjectData takes the 'serialize page as visual' branch; the manager's serializer lookup for the visual/page returns null (type unregistered or serializer factory missing).

Common situations: Custom visual types in the page without registered serializers; policy/manager misconfiguration where AcquireXmlWriterForPage/serializer pipeline is set up incompletely.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


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

Appendix: source

Thrown at src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/manager/ReachFixedPageSerializer.cs:400

        #region Private Methods

        private
        bool
        SerializePageAsVisual(
            Visual fixedPageAsVisual
            )
        {
            bool needEndVisual = false;

            ReachVisualSerializer serializer = new ReachVisualSerializer(SerializationManager);

            if(serializer!=null)
            {
                needEndVisual = serializer.SerializeDisguisedVisual(fixedPageAsVisual);
            }
            else
            {
                throw new XpsSerializationException(SR.ReachSerialization_NoSerializer);
            }

            return needEndVisual;
        }

        #endregion Private Methods
    };
}

View on GitHub (pinned to 81131a70a4)