{"record":{"id":"8ad4fef6350ba9dc","repo":"dotnet/wpf","slug":"packagepart-uri-does-not-correspond-to-a-fixedpage","errorCode":null,"errorMessage":"PackagePart URI does not correspond to a FixedPage.","messagePattern":"PackagePart URI does not correspond to a FixedPage\\.","errorType":"exception","errorClass":"XpsPackagingException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsFixedDocumentReaderWriter.cs","lineNumber":980,"sourceCode":"                    }\n                }\n            }\n        }\n\n        private\n        IXpsFixedPageReader\n        AddPageToCache( Uri pageUri )\n        {\n            PackagePart pagePart = CurrentXpsManager.GetPart(pageUri);\n\n            if (pagePart == null)\n            {\n                 throw new XpsPackagingException(SR.ReachPackaging_PartNotFound);\n            }\n\n            if (!pagePart.ValidatedContentType().AreTypeAndSubTypeEqual(XpsS0Markup.FixedPageContentType))\n            {\n                throw new XpsPackagingException(SR.ReachPackaging_NotAFixedPage);\n            }\n\n            //\n            // Create the reader/writer for the part\n            //\n            IXpsFixedPageReader pageReader = new XpsFixedPageReaderWriter(CurrentXpsManager, this, pagePart, null, _pageCache.Count+1);\n\n            //\n            // Cache the new reader/writer for later\n            //\n            _pageCache.Add(pageReader );\n\n            return pageReader;\n        }\n\n        private\n        void\n        EnsureThumbnail()","sourceCodeStart":962,"sourceCodeEnd":998,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsFixedDocumentReaderWriter.cs#L962-L998","documentation":"XpsFixedDocumentReaderWriter.AddPageToCache throws XpsPackagingException (ReachPackaging_NotAFixedPage) when the part at the page URI exists but its validated content type (including sub-type) is not the XPS FixedPage content type. The part found via the relationship is not a FixedPage as required.","triggerScenarios":"A FixedDocument page relationship points to a part whose validated content type does not equal XpsS0Markup.FixedPageContentType (e.g. it is a FixedDocument, image, or arbitrary part).","commonSituations":"Hand-built or third-party-generated XPS packages with wrong relationship targets; parts labeled with wrong content types; bugs in XPS conversion tools.","solutions":["Correct the relationship target to point at a part with the FixedPage content type ('application/vnd.ms-package.xps-fixedpage').","Fix the part's Content-Type metadata in the package if it is actually a FixedPage but mislabeled.","Regenerate the package with standard XPS writing APIs instead of manual OPC manipulation.","Validate the package structure with a validator before loading."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var part = xpsManager.GetPart(pageUri);\nif (part == null || !part.ValidatedContentType().AreTypeAndSubTypeEqual(XpsS0Markup.FixedPageContentType))\n    throw new Exception(\"URI is not a FixedPage: \" + pageUri);","typeGuard":null,"tryCatchPattern":"try { ParsePages(); }\ncatch (XpsPackagingException ex) when (ex.Message.Contains(\"FixedPage\")) { /* skip/repair mislabeled part */ }","preventionTips":["Ensure page relationships point only to FixedPage-typed parts.","Use standard XPS writers to produce packages.","Run a package validator before consumption."],"tags":["wpf","xps","content-type","schema-validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}