[ACCEPTED]-Strong Name sn.exe: Failed to install key pair -- Object already exists-strong-named-key

Accepted answer
Score: 62

I have managed to resolve my issue, without 19 fully understanding the cause. I found a 18 post about a similar issue here, but did not 17 fit my circumstance precisely, as I had 16 only ever logged on to my machine as a single 15 user.

The post showed how to delete the container, but 14 I couldn't do this either as it said the 13 container didn't exist. What it did though 12 was prompt me to run the command prompt 11 as an Administrator, which I had not done 10 previously. This allowed me to uninstall 9 and re-install the certificate, and both 8 versions of the project now build successfully.

My 7 assumption is that somehow the certificate 6 had initially been installed (by me) under 5 a different user than the one I tried to 4 install with the second time, though I don't 3 know why this would be, as I have only ever 2 logged on to the machine as a single user. It 1 remains something of a mystery to me.


Summary:

  1. Start the developer command prompt as administrator, otherwise you'll get a misleading error saying the container doesn't exist.
  2. Run sn -d VS_KEY_XXXXXXXXXXX to remove the old key.
  3. You should now be able to reinstall the certificate.
Score: 6

We had the same problem after doing a "refresh" on 10 Windows 10. Here's what worked for us:

  1. Start a command prompt as administrator.
  2. Run "sn -m n" to make certificates user-based rather than machine-based.
  3. Install the certificate as normal (either "sn -i VS_KEY_XX" or using the "properties" dialog in VS).

It 9 was like the refresh stored the old containers 8 in some hidden area, where they couldn't 7 be deleted (but also interfered with the 6 addition of the same container). Changing 5 to user-based allows a clean slate from 4 the current user's perspective. Note that 3 if you have multiple users on the same machine, they 2 would probably each need to register the 1 certificates.

More Related questions