title: SignedXml.CheckSignature always fails when using .NET 4 or 4.5, but works in .NET 3.5, 3 or 2
body: <p>I'm having troubles while trying to validate signature of signed XML document.
  Validation fails when using .NET framework 4.0 or 4.5, but passes in 3.5, 3.0 and 2.0.
  XML document is from 3rd party Java based service.</p>
  
  <p>Code used for signature validation:
  </p>
  
  <pre><code> public static Boolean VerifyXmlFile(String filename)
      {
          // Create a new XML document.
          var xmlDocument = new XmlDocument() { PreserveWhitespace = true };
  
          // Load the passed XML file into the document. 
          xmlDocument.Load(filename);
  
          // Create a new SignedXml object and pass it 
          // the XML document class.
          var signedXml = new SignedXml(xmlDocument);
  
          // Find the "Signature" node and create a new 
          // XmlNodeList object.
          XmlNodeList nodeList = xmlDocument.GetElementsByTagName("Signature");
  
          // Load the signature node.
          signedXml.LoadXml((XmlElement)nodeList[0]);
  
          // Check the signature using known certifricate and return the result. 
          var certificate = new X509Certificate2("testCert.cer", "");
          return signedXml.CheckSignature(certificate.PublicKey.Key);
      }
  </code></pre>
  
  <p>I've tried to check signature both manually and direct from 3rd party response stream, but the result is always false in .NET 4.0 or 4.5.</p>
  
  <p>There was known issue in .NET 1.1 if the signed XML contains namespace attributes on elements other than the root element: <a href="http://support.microsoft.com/kb/888999" rel="nofollow">MSDN</a>  </p>
  
  <p>Any suggestions?</p>