“Object already exists” error during Release Management server configuration

I was getting the following error while configuring RM server - "Object Already exists". Please find the log.

Database ReleaseManagement, version 12.0.30XXX.0 was installed successfully.

Created Release Management database.

Received Exception : System.Security.Cryptography.CryptographicException: Object already exists.

at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)

at System.Security.Cryptography.Utils._CreateCSP(CspParameters param, Boolean randomKeyContainer, SafeProvHandle& hProv)

at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)

at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)

at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()

at Microsoft.TeamFoundation.Release.CommonConfiguration.Helpers.CryptoHelper.ConfigureServerCryptoKey(String serverName, String databaseName)

at Microsoft.TeamFoundation.Release.Configuration.ConfigurationManager.Configure(ConfigurationUpdatePack updatePack, DelegateStatusUpdate statusListener)

at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

Work completed for GetConfiguration() call : got out of turn error

Object already exists.

 

To fix the problem, you need to make sure that the credentials used to configure the Release Management server has modify permissions on C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys. You might have to take ownership of some of the files within that folder before you can grant yourself modify permissions.