title: ArgumentException "Value was invalid" when calling RSACryptoServiceProvider.SignData
body: <p>I'm getting a System.ArgumentException "Value was invalid" when calling RSACryptoServiceProvider.SignData with the following code:</p>
  
  <pre><code>var csp = (RSACryptoServiceProvider)_certificate.PrivateKey;
  string simpleName = CryptoConfig.MapNameToOID("SHA256");
  return csp.SignData(data, simpleName);
  </code></pre>
  
  <p>The code is from a third party sample so it should work in the right circumstances. It seems it could be caused by my OS but I haven't found a solution so thought I'd post here to see if someone can help?</p>
  
  <p>.NET Framework: 3.5
  OS: Microsoft Windows Server 2003 R2 Enterprise Edition Service Pack 2</p>