{"record":{"id":"07e1f1ec3b5d4f13","repo":"dotnet/wpf","slug":"sr-multiplerelationshiptransformsfound","errorCode":null,"errorMessage":"SR.MultipleRelationshipTransformsFound","messagePattern":"SR\\.MultipleRelationshipTransformsFound","errorType":"exception","errorClass":"System.Xml.XmlException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/XmlSignatureManifest.cs","lineNumber":363,"sourceCode":"                    // what type of transform?\n                    if (string.Equals(transformName, XTable.Get(XTable.ID.RelationshipsTransformName), StringComparison.Ordinal))\n                    {\n                        if (!relationshipTransformFound)\n                        {\n                            // relationship transform\n                            ParseRelationshipsTransform(reader, partUri, ref relationshipSelectors);\n\n                            if (transforms == null)\n                                transforms = new List<String>();\n\n                            transforms.Add(transformName);\n\n                            relationshipTransformFound = true;\n                            transformsCountWhenRelationshipTransformFound = transforms.Count;\n                            continue;   // success\n                        }\n                        else\n                            throw new XmlException(SR.MultipleRelationshipTransformsFound);\n                    }                    \n                    else\n                    {\n                        // non-Relationship transform should have no children\n                        if (reader.IsEmptyElement)\n                        {\n                            if (transforms == null)\n                                transforms = new List<String>();\n\n                            if (XmlDigitalSignatureProcessor.IsValidXmlCanonicalizationTransform(transformName))\n                            {\n                                transforms.Add(transformName);  // return it\n                                continue;   // success\n                            }\n                            else\n                                throw new InvalidOperationException(SR.UnsupportedTransformAlgorithm);\n                        }\n                    }","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/XmlSignatureManifest.cs#L345-L381","documentation":"The manifest contained more than one Relationship transform for the same Reference. The OPC spec permits at most a single Relationship Transform per Reference, so when a second one is detected the library throws MultipleRelationshipTransformsFound.","triggerScenarios":"Verify on a signature whose Reference lists two <Transform Algorithm=\".../RelationshipTransform\"> entries (or one with multiple relationship selections producing a second transform) for the same part.","commonSituations":"Signing tools that append a Relationship transform for each relationship type instead of consolidating into one; templates copied and merged incorrectly; automated pipelines adding the transform repeatedly.","solutions":["Edit the signature so only one Relationship Transform appears per Reference, and re-sign","Configure the signing tool to emit a single Relationship Transform covering all needed relationship types","Re-sign the package entirely with PackageDigitalSignatureManager instead of the offending tool","Regenerate the package signature after fixing the manifest template"],"exampleFix":"// before\n<Transforms>\n  <Transform Algorithm=\"http://schemas.openxmlformats.org/package/2006/RelationshipTransform\"/>\n  <Transform Algorithm=\"http://schemas.openxmlformats.org/package/2006/RelationshipTransform\"/>\n</Transforms>\n// after\n<Transforms>\n  <Transform Algorithm=\"http://schemas.openxmlformats.org/package/2006/RelationshipTransform\"/>\n</Transforms>","handlingStrategy":"validation","validationCode":"const string relNs = \"http://schemas.openxmlformats.org/package/2006/RelationshipTransform\";\nint relCount = doc.Descendants(ds + \"Reference\")\n    .Count(r => r.Elements(ds + \"Transforms\").Descendants(ds + \"Transform\")\n        .Count(t => (string)t.Attribute(\"Algorithm\") == relNs) > 1);\nif (relCount > 0) throw new InvalidDataException(\"Duplicate Relationship Transform in a Reference\");","typeGuard":null,"tryCatchPattern":"try\n{\n    sigManager.VerifySignatures(true);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"Relationship\"))\n{\n    // duplicate Relationship transform: re-sign with a compliant tool\n}","preventionTips":["Emit at most one Relationship Transform per Reference","Consolidate all relationship selections into the single transform","Audit signing templates for duplicated transform entries","Diff generated signature XML against a known-good sample"],"tags":["wpf","packaging","xml-signature","opc"],"backgroundTag":"invalid-argument-value","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"}