{"record":{"id":"7373376836487369","repo":"dotnet/wpf","slug":"sr-invaliduriattribute","errorCode":null,"errorMessage":"SR.InvalidUriAttribute","messagePattern":"SR\\.InvalidUriAttribute","errorType":"exception","errorClass":"XmlException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/XmlDigitalSignatureProcessor.cs","lineNumber":1198,"sourceCode":"\n                        //If there are more than one package specific tags\n                        if (packageReferenceFound)\n                            throw new XmlException(SR.MoreThanOnePackageSpecificReference);\n                        else\n                            packageReferenceFound = true;\n                    }\n\n                    currentTransformChain = currentReference.TransformChain;\n\n                    for(int j=0; j<currentTransformChain.Count; j++)\n                    {\n                        //As per the OPC spec, only two transforms are supported for the reference tags\n                        if (!IsValidXmlCanonicalizationTransform(currentTransformChain[j].Algorithm))\n                            throw new XmlException(SR.UnsupportedTransformAlgorithm);\n                    }\n                }\n                else\n                    throw new XmlException(SR.InvalidUriAttribute);\n            }\n\n            // If there are zero reference tags or if there wasn't any package specific reference tag            \n            if (allowPackageSpecificReferences && !packageReferenceFound)\n                throw new XmlException(SR.PackageSignatureReferenceTagRequired);\n        }\n\n\n        //------------------------------------------------------\n        //\n        //  Private Members\n        //\n        //------------------------------------------------------\n        private PackagePart _signaturePart;\n        private X509Certificate2                    _certificate;       // non-null if it's embedded\n        private bool                                _lookForEmbeddedCert;\n        private PackageDigitalSignatureManager      _manager;\n        private PackageDigitalSignature             _signature;         // parsed from part or newly created","sourceCodeStart":1180,"sourceCodeEnd":1216,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/XmlDigitalSignatureProcessor.cs#L1180-L1216","documentation":"ValidateReferences throws this XmlException when a Reference's Uri attribute is not a fragment identifier — per the OPC spec the Uri must be relative using '#...' form; absolute URIs are rejected as invalid.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/XmlDigitalSignatureProcessor.cs:1198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure each Reference Uri attribute uses only a fragment identifier (starts with '#') per the OPC spec","Re-generate the signature so references are relative fragments, not absolute URIs","Treat the XmlException as a verification failure for non-conformant signatures"],"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"}