Saturday, October 07, 2006

Error 8013141C in Visual Studio or sn.exe

I have an earlier post about Error "8013141C" in Visual Studio .NET 2003 or sn.exe from any of the .NET toolkits.

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:
  1. Browse to %SystemDrive%\Documents and Settings\AllUsers\ApplicationData\Microsoft\Crypto\RSA\MachineKeys
  2. Grant rights to Adminstrators, or whatever group you belong to
  3. Take Ownership of this folder (click Advanced under Security, and then click the Ownership tab at the top)
  4. Apply the changes to the children ("Replicate permission...")



9 comments:

Anonymous said...

Thank you very much, you solved my problem. God bless you.

Anonymous said...

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.

Anonymous said...

Thank you! It help me find the problem fast!

Mohammad said...

Windows 7 folder

C:\Windows\System32\Microsoft\Crypto\RSA

Anonymous said...

Thanks Mohammad. Saved me some headaches. was trying to find it under c:\users\xxx. but obviously that was moved elsewhere.

Anonymous said...

Oh, on windows 64bit, it's located here:
C:\Windows\SysWOW64\Microsoft\Crypto\RSA

Anonymous said...

Great post! Thanks...

Pablo Sanchez said...

Thank you, very helpful.

Matt said...

This didn't fix the issue for me. Using Microsoft process monitor I found the problem directory located at
C:\ProgramData\Microsoft\Crypto\RSA