After beating my head against the wall for half a day I finally figured out why I am getting an exception "Object already exists." when trying to instantiated an RSACryptoServiceProvider.
Here was my C# code from .NET 1.1 which worked fine under my ASPNET windows user account:
CspParameters csp = new CspParameters();
csp.KeyContainerName = "MySecretKeyContainer";
svrRSA = new RSACryptoServiceProvider(csp);
When I ran this same code in .NET 2.0 also under my ASPNet windows user account.
I got the following exception and stack trace:
Object already exists.
ÃÂ ÃÂ at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
ÃÂ ÃÂ at System.Security.Cryptography.Utils._CreateCSP(CspParameters param, Boolean randomKeyContainer, SafeProvHandle& hProv)
ÃÂ ÃÂ at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
View Complete Post