10

Visual Studio 2013 - Started to receive the error: "Error signing assembly -- Unknown error (8013141c)" when compiling. Few of the projects are signed using a snk file. It used to compile and has been in production for quite some time.

Vin
  • 942
  • 8
  • 13
  • 1
    Please note: Some of the projects need to be signed. I cannot deploy without signing. – Vin May 03 '16 at 20:33
  • Check this: https://social.msdn.microsoft.com/Forums/en-US/c92b79a0-109a-4085-94db-a5f5420c2457/alink-error-al1078-error-signing-assembly-unknown-error-8013141c?forum=csharplanguage – Gusman May 03 '16 at 20:34
  • Has the signing cert expired possibly? – pmcilreavy May 03 '16 at 21:31
  • Does this answer your question? [Signing assembly Access Is Denied](https://stackoverflow.com/questions/4606342/signing-assembly-access-is-denied) – oleksa Jan 31 '20 at 09:33

4 Answers4

22

This is a permission issue. To resolve this error; open the following folder - “C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys”, and give your user (whatever account you use to log onto your computer and work on Visual Studio) full control. You can do it by right-clicking on the MachineKeys folder and select properties, and in the security tab, make sure the current user have full control.

Jon
  • 3,230
  • 1
  • 16
  • 28
  • 3
    Thanks, I changed the MachineKeys folder located under: C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys Just to be safe, I restarted the server and ensured that VS is opened as an "Administrator" – Vin May 03 '16 at 22:06
  • 1
    It's odd that it needs your actual user. Administrators had Full Control in there and I'm an admin on the machine. Whats also odd about this is that it can just start happening for no apparent reason as mine just did. – James_UK_DEV Aug 24 '16 at 11:41
  • Still, facing the errors after doing this? So this is the only solution for this type of errors? Is there any other way to solve this? – Nguyễn Đức Tâm Jan 09 '20 at 04:56
  • Did you try the solution below to add full permission to this folder? C:\Users\All Users\Microsoft\Crypto\RSA\MachineKeys – Jon Jan 24 '20 at 17:17
  • This worked for me! The service account running the TFS build agent did not have Full Control for the MachineKeys folder. For Windows 10 the folder is C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys. I don't know why signing it requires Full Control, but I tried granting only Read access to the service account first which failed. Full Control worked. – bargz Jan 29 '20 at 14:50
6

Run Visual Studio with elevated permissions, as an Administrator.

IanL
  • 69
  • 1
  • 1
  • 1
    Especially if this crap shows up suddenly, in a build that used to compile fine, and when your user already has all needed permissions for MachineKeys. – Liz Sep 26 '18 at 08:34
3

Building on Mangist above, his solution worked for me, but I have Windows 10 so MachineKeys are in a different folder. I gave myself full control (probably only need read/write) of the following folder:

C:\Users\All Users\Microsoft\Crypto\RSA\MachineKeys

It said access denied for some of the keys, but once the process was done, I no longer see the Error signing Assembly issue.

halfer
  • 19,824
  • 17
  • 99
  • 186
Keenan Stewart
  • 594
  • 6
  • 9
-4

open the project properties, go to the Signing Tab and uncheck the Sign the assembly checkbox.and rebuld

suulisin
  • 1,414
  • 1
  • 10
  • 17
  • 1
    But what if the OP wants to sign this assembly? This is not a solution, this is just avoiding the required task. – Glen Thomas May 04 '16 at 12:10