Exception type: CryptographicException Exception message: Object already exists.
I had a application hosted in IIS. On trying to browse the site, I got the following exception in the Event Viewer:
Exception type: CryptographicException Exception message: Object already exists.
This happens because the program is running with different users; One with normal user and another with startup user.
When the key is created, its permission is only granted to the creator.
Solution:
Step 1. In IIS, change the Identity of the application pool under which the website is running. The identity will be your user credentials.
Step 2. Do IISRESET
Comments
- Anonymous
June 21, 2016
Apply the account to the Cryptographic Container using an aspnet_regiis command:aspnet_regiis -pa "SampleKeys" "NT AUTHORITY\NETWORK SERVICE"