{"record":{"id":"0b7617a243c7fc61","repo":"dotnet/wpf","slug":"sr-reachserialization-noserializer-ngcserializer","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/NGCSerializer.cs","lineNumber":736,"sourceCode":"        /// The PageContent to be serialized.\n        /// </param>\n        private\n        void\n        SerializePageContent(\n            object pageContent\n            )\n        {\n            Toolbox.EmitEvent(EventTrace.Event.WClientDRXSavePageBegin);\n\n            ReachSerializer serializer = SerializationManager.GetSerializer(pageContent);\n\n            if(serializer!=null)\n            {\n                serializer.SerializeObject(pageContent);\n            }\n            else\n            {\n                throw new XpsSerializationException(SR.ReachSerialization_NoSerializer);\n            }\n\n            Toolbox.EmitEvent(EventTrace.Event.WClientDRXSavePageEnd);\n        }\n\n        #endregion Private Methods\n\n        /// <summary>\n        /// The method is called once the object data is discovered at that\n        /// point of the serialization process.\n        /// </summary>\n        /// <param name=\"serializableObjectContext\">\n        /// The context of the object to be serialized at this time.\n        /// </param>\n        internal\n        override\n        void\n        PersistObjectData(","sourceCodeStart":718,"sourceCodeEnd":754,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/manager/NGCSerializer.cs#L718-L754","documentation":"SerializePageContent looks up a ReachSerializer for a PageContent and, when GetSerializer returns null, throws XpsSerializationException(SR.ReachSerialization_NoSerializer). This happens while enumerating a FixedDocument's pages: one PageContent's referenced object has no registered serializer.","triggerScenarios":"During FixedDocument serialization, a PageContent whose child (typically the FixedPage from PageContent.GetPageRoot) cannot be resolved to a registered serializer type.","commonSituations":"PageContent entries whose page source fails to load and returns an unexpected type; mixed-version documents containing custom page content types.","solutions":["Verify each PageContent resolves to a standard FixedPage (check the page's Source URI loads correctly).","Remove or replace custom/foreign page content types unsupported by the XPS writer.","Log the offending PageContent before throwing so the bad page in the document can be identified."],"exampleFix":"// before\nserializer = manager.GetSerializer(pageContent);\n// after\nserializer = manager.GetSerializer(pageContent);\nif (serializer == null)\n    throw new XpsSerializationException($\"No serializer for PageContent {pageContent.Source}\");","handlingStrategy":"try-catch","validationCode":"foreach (PageContent pc in fixedDocument.Pages)\n    if (manager.GetSerializer(pc) == null)\n        throw new InvalidOperationException($\"No serializer for PageContent {pc.Source}\");","typeGuard":null,"tryCatchPattern":"try { serializer.SerializeObject(pageContent); }\ncatch (XpsSerializationException ex) when (ex.Message.Contains(\"NoSerializer\")) { /* log pc.Source; skip or replace the page */ }","preventionTips":["Ensure all PageContent sources resolve to standard FixedPages","Validate page sources load before serializing the document","Reject foreign/custom page content types at document build time"],"tags":["wpf","xps","serialization","missing-serializer"],"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"}