Runtime: ALINK : error AL1078: Error signing assembly -- Access is denied.

Created on 12 Oct 2015  路  8Comments  路  Source: dotnet/runtime

Getting build errors on Win10 + VS2015:

ALINK : error AL1078: Error signing assembly -- Access is denied. [s:\c1\src\Microsoft.CSharp\src\Microsoft.CSharp.csproj]

From the log:

   175>GenerateSatelliteAssemblies:
         Creating directory "s:\c1\bin/obj/Windows_NT.AnyCPU.Debug\Microsoft.CSharp\it".
         Creating directory "s:\c1\bin/obj/Windows_NT.AnyCPU.Debug\Microsoft.CSharp\ja".
         Creating directory "s:\c1\bin/obj/Windows_NT.AnyCPU.Debug\Microsoft.CSharp\ko".
         Creating directory "s:\c1\bin/obj/Windows_NT.AnyCPU.Debug\Microsoft.CSharp\ru".
         Creating directory "s:\c1\bin/obj/Windows_NT.AnyCPU.Debug\Microsoft.CSharp\zh-Hans".
         Creating directory "s:\c1\bin/obj/Windows_NT.AnyCPU.Debug\Microsoft.CSharp\zh-Hant".
         C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\AL.exe /culture:de /delaysign+ /keyfile:s:\c1\packages/Microsoft.DotNet.BuildTools.1.0.25-prerelease-00104/lib/MSFT.snk /out:s:\c1\bin/obj/Windows_NT.AnyCPU.Debug\Microsoft.CSharp\de\Microsoft.CSharp.resources.dll /template:s:\c1\bin/obj/Windows_NT.AnyCPU.Debug\Microsoft.CSharp\Microsoft.CSharp.dll /embed:s:\c1\bin/obj/Windows_NT.AnyCPU.Debug\Microsoft.CSharp\Microsoft.CSharp.Resources.Strings.de.resources

   175>ALINK : error AL1078: Error signing assembly -- Access is denied. [s:\c1\src\Microsoft.CSharp\src\Microsoft.CSharp.csproj]
   175>Done Building Project "s:\c1\src\Microsoft.CSharp\src\Microsoft.CSharp.csproj" (BuildAndTest target(s)) -- FAILED.

msbuild.log.txt

area-Infrastructure-libraries area-Microsoft.CSharp bug

Most helpful comment

Thanks. This way work good(win 10, VS 2013):

The fix for me was to add myself to the list of permissions of C:\Users\All Users\Microsoft\Crypto\RSA\MachineKeys folder with Full Control. A side note: I'm a participant of Administrators group and it was there with Full Control but it wasn't enough.

All 8 comments

This error seems really rare, but I'm getting it too in my project. One thing I noticed is that it only happens when I add non English resx files. I take them out and the problem goes away. Running as administrator doesn't matter.

Hope someone finds the root cause.

This is not rare on my box: I get this almost 1/2 the times I build using build.cmd outside of a VC2015 x86 command prompt.

This is not related to Microsoft.CSharp, which is a library for supporting language features such as dynamic, while ALINK is a build time tool.

I am closing this since this is clearly not the right repo.
Will try to find where ALINK bugs should go.

Experienced this very issue on a clean Windows 10 Pro install.

The only extra thing I can think of: I ticked the "Encrypt" checkbox for one of my folders. Ticking that checkbox at the first time causes Windows OS to generate some cryptographic keys for NTFS file encryption. This can be a contributing factor for an issue to manifest itself.

The exact sequence looks like so:

  1. Install Windows 10 Pro x64 Version 1803 (OS Build 17134.81)
  2. Execute dism /online /Enable-Feature /FeatureName:NetFx3
  3. Create and empty Keys folder at C:\Users\%USERNAME%\Documents
  4. Create a text file C:\Users\%USERNAME%\Documents\Keys\1.txt with content 123
  5. Go back to C:\Users\%USERNAME%\Documents and encrypt the Keys folder (Properties -->General --> Advanced... -> Encrypt contents to secure data)
  6. Install Visual Studio 2017
  7. Try to build some .NET 2.0 Windows Forms project that uses key signing in .snk file format
    (a possible contributing factor: build an _existing_ project to avoid the generation of an assembly signing key first)

Building for .NET Framework 2.0 seems to be an important condition as I get this error only for .NET Framework 2.0 projects. All F# projects produce the assembly signing error not matter what .NET versions they target. A particular failing one was F# 4.1 (FSharp.Core, 4.4.1.0) targeting .NET Framework 4.5.

The fix for me was to add myself to the list of permissions of C:\Users\All Users\Microsoft\Crypto\RSA\MachineKeys folder with Full Control. A side note: I'm a participant of Administrators group and it was there with Full Control but it wasn't enough.

Thanks. This way work good(win 10, VS 2013):

The fix for me was to add myself to the list of permissions of C:\Users\All Users\Microsoft\Crypto\RSA\MachineKeys folder with Full Control. A side note: I'm a participant of Administrators group and it was there with Full Control but it wasn't enough.

I just have hit this issue once again. This time it happened at a virtual machine environment.

So I have a repro for this issue as VMware image file.

Is anybody interested? Should I prepare the file and steps to reproduce?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jkotas picture jkotas  路  3Comments

nalywa picture nalywa  路  3Comments

btecu picture btecu  路  3Comments

matty-hall picture matty-hall  路  3Comments

GitAntoinee picture GitAntoinee  路  3Comments