Strong Name sn.exe: Failed to install key pair — Object already exists

后端 未结 2 1806
执念已碎
执念已碎 2021-02-03 20:56

I have 2 different versions of the same project on my machine. One from the code trunk, and the other from a code branch. These projects use a .pfx key to enable strong naming.

2条回答
  •  一生所求
    2021-02-03 21:35

    We had the same problem after doing a "refresh" on 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 was like the refresh stored the old containers in some hidden area, where they couldn't be deleted (but also interfered with the addition of the same container). Changing to user-based allows a clean slate from the current user's perspective. Note that if you have multiple users on the same machine, they would probably each need to register the certificates.

提交回复
热议问题