dotnet/wpf · error · XpsSerializationException

SR.ReachSerialization_NoSerializer

Error message

SR.ReachSerialization_NoSerializer

What it means

Async counterpart of 3726: ReachFixedPageSerializerAsync.SerializePageAsVisual throws XpsSerializationException (ReachSerialization_NoSerializer) when no serializer is available to serialize the FixedPage as a disguised visual. Called from PersistObjectData, the missing serializer aborts the async package write.

Solutions

  1. Register a serializer for the custom visual type used in async serialization
  2. Stick to built-in FixedPage visuals for the async path
  3. Align the packaging policy with the async serializer capabilities before writing
Defensive patterns

Strategy: try-catch

Validate before calling

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.WriteAsync(page); } catch (System.Windows.Xps.XpsSerializationException ex) { log.Error("Async visual serializer missing for " + page.GetType(), ex); throw; }

Prevention

When it happens

Trigger: Async PersistObjectData selects the visual-serialization branch for a page; the serializer lookup returns null (unregistered visual type or incomplete serializer setup).

Common situations: Async writes of pages containing custom visuals; pipeline configured for markup-only serialization while the policy requests visual serialization.

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/21da427c812a6803. Report an issue: GitHub.

Appendix: source

Thrown at src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/manager/ReachFixedPageSerializerAsync.cs:372

        #region Private Methods

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

            ReachVisualSerializerAsync serializer = new ReachVisualSerializerAsync(SerializationManager);

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

            return needEndVisual;
        }

        private
        void
        EndSerializeReachFixedPage(
            ReachFixedPageSerializerContext context
            )
        {
            ReachFixedPageSerializerContext thisContext = context as ReachFixedPageSerializerContext;

            if(thisContext != null)
            {
                if(thisContext.EndVisual)
                {
                    XmlWriter           pageWriter  = ((XpsSerializationManagerAsync)SerializationManager).

View on GitHub (pinned to 81131a70a4)