{"record":{"id":"88362856c514f14e","repo":"dotnet/wpf","slug":"reachpackaging-notopenforreading","errorCode":null,"errorMessage":"ReachPackaging_NotOpenForReading","messagePattern":"ReachPackaging_NotOpenForReading","errorType":"exception","errorClass":"XpsPackagingException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsDocument.cs","lineNumber":589,"sourceCode":"        /// <returns>A XpsPartBase representing the root.</returns>\n        /// <remarks>Method will be internal until reading/de-serialization is implemented.</remarks>\n        /// <exception cref=\"SR.ReachPackaging_PackageUriNull\">XpsPakage Uri is null.  Use XpsDocument constructor that takes Uri parameter.</exception>\n        /// <exception cref=\"SR.ReachPackaging_InvalidStartingPart\">Package starting part is not a valid root.</exception>\n        /// <exception cref=\"SR.ReachPackaging_NotAFixedDocumentSequence\">Part Uri does not corresepond to  a Fixed Document Sequence.</exception>\n        public\n        FixedDocumentSequence\n        GetFixedDocumentSequence(\n            )\n        {\n            CheckDisposed();\n        \n            if( CurrentXpsManager == null )\n            {\n                throw new InvalidOperationException(SR.ReachPackaging_DocumentWasClosed);\n            }\n            if (!IsReader)\n            {\n                throw new XpsPackagingException(SR.ReachPackaging_NotOpenForReading);\n            }\n\n            if (null == Uri)\n            {\n                throw new XpsPackagingException(SR.ReachPackaging_PackageUriNull);\n            }\n\n            if (CurrentXpsManager.StartingPart == null)\n            {\n                return null;\n            }\n\n            ContentType startPartType = CurrentXpsManager.StartingPart.ValidatedContentType();\n            if (!startPartType.AreTypeAndSubTypeEqual(XpsS0Markup.DocumentSequenceContentType))\n            {\n                 throw new XpsPackagingException(SR.ReachPackaging_InvalidStartingPart);\n            }\n            ParserContext parserContext = new ParserContext","sourceCodeStart":571,"sourceCodeEnd":607,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsDocument.cs#L571-L607","documentation":"GetFixedDocumentSequence throws this XpsPackagingException when the XpsDocument was not opened for reading (IsReader is false — e.g. opened write-only or for creation). Reading the root fixed document sequence requires read access to the package.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsDocument.cs:589 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the XpsDocument with access mode that allows reading (or FileAccess.Read / ReadWrite) instead of write-only","Open a new XpsDocument instance with read access to consume the content"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}