0

In Visual Studio 2012, when running in Debug mode using the built-in server ("Use Visual Studio Development Server") the following code runs fine:

    Dim mySignedXml As SignedXml = SignResponse(doc, cert)
    Dim xml As XmlElement = mySignedXml.GetXml()  

But when I choose "Use Local IIS Web Server" setting in Visual Studio, the GetXml() method fails with this error:

     System.Security.Cryptography.CryptographicException: 
     A signature method is required.

This is on a Windows 7 x64 PC, not a server. What change must be made to the Local IIS Web Server configuration so this code works there too?

Tim
  • 8,669
  • 31
  • 105
  • 183
  • Where is the certificate loaded from? – Wiktor Zychla Nov 13 '13 at 20:53
  • You asked the right question, Wiktor :-) The IIS built-in user doesn't have access to the folder where the key file is stored, so I'll have to relocate the file. `myX509Certficate2.Import(CertificatePath, "passwordhere", X509KeyStorageFlags.MachineKeySet)` – Tim Nov 14 '13 at 16:42

0 Answers0