{"record":{"id":"1ff6712581e5d68a","repo":"dotnet/wpf","slug":"reachpackaging-notsignaturedefinitionelement","errorCode":null,"errorMessage":"ReachPackaging_NotSignatureDefinitionElement","messagePattern":"ReachPackaging_NotSignatureDefinitionElement","errorType":"exception","errorClass":"XpsPackagingException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XPSSignatureDefinition.cs","lineNumber":417,"sourceCode":"        /// </summary>\n        /// <param name=\"reader\">\n        /// The XML Reader used to read the data\n        /// </param>\n        internal\n        void\n        ReadXML( XmlReader reader )\n        {\n            ArgumentNullException.ThrowIfNull(reader);\n\n            //\n            // Assume the calling function has already read the\n            // SignatureDefinition start element\n            //\n            if( reader.NodeType != XmlNodeType.Element ||\n                reader.Name != XpsS0Markup.SignatureDefinition\n              )\n            {\n                throw new XpsPackagingException(SR.ReachPackaging_NotSignatureDefinitionElement);\n            }\n\n            bool exitLoop = false;\n\n            //\n            // Read the attributes off of SignatureDefinition\n            //\n            ReadAttributes( reader );\n\n            while( !exitLoop && reader.Read() )\n            {\n                switch( reader.NodeType )\n                {\n                    case XmlNodeType.Element:\n                        ReadElement( reader );\n                        break;\n\n                    case XmlNodeType.EndElement:","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XPSSignatureDefinition.cs#L399-L435","documentation":"ReadXML assumes the caller has already consumed the SignatureDefinition start element; if the reader's current node is not an element or its name is not SignatureDefinition, an XpsPackagingException is thrown. This fires when deserializing an XPS package whose signature-definition XML is misplaced or malformed.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XPSSignatureDefinition.cs:417 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure ReadXML is invoked only after the reader has consumed the SignatureDefinition start element","Verify the XML being parsed actually contains a SignatureDefinition element","Advance or position the XmlReader on the SignatureDefinition element before calling ReadXML"],"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"}