{"record":{"id":"373f08286e8ae7cb","repo":"dotnet/wpf","slug":"sr-reachserialization-noserializer","errorCode":null,"errorMessage":"SR.ReachSerialization_NoSerializer","messagePattern":"SR\\.ReachSerialization_NoSerializer","errorType":"exception","errorClass":"XpsSerializationException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/manager/NGCSerializationManagerAsync.cs","lineNumber":128,"sourceCode":"\n                if(reachSerializer != null)\n                {\n                    //\n                    // Prepare the context that is going to be pushed on the stack\n                    //\n                    SerializationManagerOperationContextStack\n                    contextStack = new SerializationManagerOperationContextStack(reachSerializer,\n                                                                                 serializedObject);\n                    //\n                    // At this stage, start calling another method which would peak at the stack\n                    //\n                    _operationStack.Push(contextStack);\n\n                    PostSerializationTask(new DispatcherOperationCallback(InvokeSaveAsXamlWorkItem));\n                }\n                else\n                {\n                    throw new XpsSerializationException(SR.ReachSerialization_NoSerializer);\n                }\n            }\n        }\n\n        internal\n        Object\n        InvokeSaveAsXamlWorkItem(\n            Object arg\n            )\n        {\n            try\n            {\n                if(!_serializationOperationCanceled)\n                {\n                    if(_operationStack.Count > 0)\n                    {\n                        Object objectOnStack = _operationStack.Pop();\n","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/manager/NGCSerializationManagerAsync.cs#L110-L146","documentation":"Async NGCSerializationManager.SaveAsXaml, after deciding how to schedule the SaveAsXaml work item, found no serializer registered for the object's type and threw XpsSerializationException(SR.ReachSerialization_NoSerializer). This is the async twin of the synchronous NGCSerializationManager check, hit when GetSerializer returns null for the queued object.","triggerScenarios":"Async SaveAsXaml invoked with an object type for which the serializer registry lookup fails — typically a non-Fixed* type pushed through the async work-item path.","commonSituations":"Queuing custom document parts to the async pipeline; type mismatches after refactoring (e.g. passing a FixedPage where the manager expected a FixedDocument context).","solutions":["Pass only FixedDocumentSequence / FixedDocument / FixedPage objects to SaveAsXaml.","Register or select the correct serializer for the type before starting the async save.","Add a pre-call type check so an actionable exception is raised before work items are queued."],"exampleFix":"// before\nasyncManager.SaveAsXaml(unknownObject);\n// after\nif (unknownObject is FixedDocumentSequence || unknownObject is FixedDocument || unknownObject is FixedPage)\n    asyncManager.SaveAsXaml(unknownObject);\nelse\n    throw new NotSupportedException($\"No XPS serializer for {unknownObject?.GetType().FullName}\");","handlingStrategy":"type-guard","validationCode":"if (!(obj is FixedDocumentSequence || obj is FixedDocument || obj is FixedPage))\n    throw new ArgumentException(\"Async SaveAsXaml requires a Fixed* type\");","typeGuard":"static bool HasXpsSerializer(object o) => o is FixedDocumentSequence or FixedDocument or FixedPage;","tryCatchPattern":"try { asyncManager.SaveAsXaml(obj); }\ncatch (XpsSerializationException ex) when (ex.Message.Contains(\"NoSerializer\")) { /* log type name of queued object */ }","preventionTips":["Validate object types before calling the async API","Do not push arbitrary DependencyObjects into the async save pipeline","Prefer the sync manager's diagnostics to identify unsupported types first"],"tags":["wpf","xps","serialization","async","unsupported-type"],"backgroundTag":"unsupported-operation","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-22T01:17:13.364Z"}