{"record":{"id":"ea78e3731bb62659","repo":"dotnet/wpf","slug":"reachpackaging-packageurinull","errorCode":null,"errorMessage":"ReachPackaging_PackageUriNull","messagePattern":"ReachPackaging_PackageUriNull","errorType":"exception","errorClass":"XpsPackagingException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsDocument.cs","lineNumber":594,"sourceCode":"        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\n            {\n                BaseUri = PackUriHelper.Create(Uri, CurrentXpsManager.StartingPart.Uri)\n            };\n\n            Uri packageUri = PackUriHelper.GetPackageUri(parserContext.BaseUri);","sourceCodeStart":576,"sourceCodeEnd":612,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsDocument.cs#L576-L612","documentation":"GetFixedDocumentSequence throws this XpsPackagingException when the XpsDocument's Uri is null — typically because the document was constructed from a stream without a package URI. Resolving the root starting part via a pack URI is impossible without a Uri, so the read is rejected.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsDocument.cs:594 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Construct the XpsDocument with the Uri overload so the package URI is known","Do not call GetFixedDocumentSequence on a package created from a bare Stream without a URI","Supply the package URI via the XpsDocument constructor before reading"],"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"}