The problem is that you cannot delete a key and you cannot add the key. This is because you do not have access to the key to delete it and the .NET framework cannot add it because of constraints on the StrongName data store.
The solution is to give yourself access to C:\Documents and Settings\AllUsers\ApplicationData\Microsoft\Crypto\RSA\MachineKeys\. This allows proper functioning when you run "sn.exe -d" allow it to remove the StrongName.
- On Windows 7 32 bit, it is located here: C:\Windows\System32\Microsoft\Crypto\RSA
- On Windows 7 64bit, it is located here: C:\Windows\SysWOW64\Microsoft\Crypto\RSA
Here is an example sequence of commands:
C:\>sn -d someKey
Microsoft (R) .NET Framework Strong Name Utility Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Failed to delete container 'someKey' -- Unable to format error message
8013141C
The key container must still exist because I cannot create a new key
container, the error message is as follows:
C:\Projects\dload\Assembly>sn -i "C:\Keys.snk" someKey
Microsoft (R) .NET Framework Strong Name Utility Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Failed to install key pair -- Object already exists.
The hack to fix this is:
- Browse to %SystemDrive%\Documents and Settings\AllUsers\ApplicationData\Microsoft\Crypto\RSA\MachineKeys
- Grant rights to Adminstrators, or whatever group you belong to
- Take Ownership of this folder (click Advanced under Security, and then click the Ownership tab at the top)
- Apply the changes to the children ("Replicate permission...")
9 comments:
Thank you very much, you solved my problem. God bless you.
Ah, the old message 8013141C. Thanks for posting this... even a couple years later, it's still helping out. Friggin' Microsoft. 8013141C. I'll give 'em a 8013141C.
Thank you! It help me find the problem fast!
Windows 7 folder
C:\Windows\System32\Microsoft\Crypto\RSA
Thanks Mohammad. Saved me some headaches. was trying to find it under c:\users\xxx. but obviously that was moved elsewhere.
Oh, on windows 64bit, it's located here:
C:\Windows\SysWOW64\Microsoft\Crypto\RSA
Great post! Thanks...
Thank you, very helpful.
This didn't fix the issue for me. Using Microsoft process monitor I found the problem directory located at
C:\ProgramData\Microsoft\Crypto\RSA
Post a Comment