Keyset does not exist error

I deployed the MVCIdentityProvider example to a test environment as it is in its original form. I keep getting the following error. This works just fine on my dev machine. I have given Read access permissions to IIS User already to the certificates in the Project folder.


Keyset does not exist

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Cryptography.CryptographicException: Keyset does not exist



This is probably a permissions problem.
Please take a look at the following topic, especially the information about the private key container.
http://www.componentspace.com/Forums/29/Troubleshooting-Loading-X.509-Certificates

I included the machone key code that is the link below but I still see the issue. Also, the error does not go away until I recyle the app pool. Any idea?

Did you set the permissions for the private key container folder (eg C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys\your-container-name)?
Are you saying it’s now working but you had to recycle the application pool?
It’s possible that you might have to recycle the application pool to have this come into effect.