2011-04-11

System.Security.Cryptography.CryptographicException: Key not valid for use in specified state

I got this message after I created a new user profile on my virtual machine (VMWare), and tried to compile my ORM project (using Telerik OpenAccess ORM). The error was wrapped as: OpenAccess Error: Key not valid for use in specified state.

This is not a problem for OpenAccess only though. I’ve seen that it also may be a problem for other applications, like SQL Server Reporting Services.

The solution:

  1. Go into the folder (Windows XP) at:
    <drive>:\Documents and Settings\<your windows user account name>\Application Data\Microsoft\Crypto\DSS\<your machine SID>\
  2. Delete the file there. It should have some cryptic name (like a GUID).
  3. Restart IIS (IISRESET).
  4. Recompile. It worked for me.

 

References:

2 comments: