{"record":{"id":"01dd3d7166f75984","repo":"dotnet/wpf","slug":"reachpackaging-invalidstartingpart","errorCode":null,"errorMessage":"ReachPackaging_InvalidStartingPart","messagePattern":"ReachPackaging_InvalidStartingPart","errorType":"exception","errorClass":"XpsPackagingException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsDocument.cs","lineNumber":605,"sourceCode":"            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);\n\n            Uri previousPackageUri = XpsLoadingContext.ActivePackageUri;\n            \n            // Establish XPS package context so that ambient-check sinks\n            // (BitmapImage, BitmapDecoder, ColorContext, FontSource, PixelShader)\n            // see the correct package origin during .fdseq parsing.\n            XpsLoadingContext.ActivePackageUri = packageUri;\n            try\n            {\n                object fixedObject = XamlReader.Load(CurrentXpsManager.StartingPart.GetStream(), parserContext, useRestrictiveXamlReader: true);\n                if (!(fixedObject is FixedDocumentSequence))","sourceCodeStart":587,"sourceCodeEnd":623,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsDocument.cs#L587-L623","documentation":"GetFixedDocumentSequence throws this XpsPackagingException when the package's starting part exists but its content type is not a valid root type (not a FixedDocumentSequence/FixedDocument content type). The package's starting part is malformed or is not a recognized XPS root.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsDocument.cs:605 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the package contains a valid starting part (FixedDocumentSequence or FixedDocument) before reading","Check CurrentXpsManager.StartingPart first; the method legitimately returns null when there is no starting part","Verify the package was saved correctly and is not truncated or empty"],"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"}