6

We are currently having problems while compiling a solution with MSBuild. The build fails randomly on the resource linking step inside the task "AL" which executes the "AL.exe" linker.

ALINK : error AL1019: Metadata failure while creating assembly -- The volume for a file has been externally altered so that the opened file is no longer valid.

The build log shows the following execution flow.

4>Target "GenerateSatelliteAssemblies" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\source\MyProject.csproj" (target "CreateSatelliteAssemblies" depends on it):
4>Building target "GenerateSatelliteAssemblies" completely.
4>Output file "obj\Debug\de\MyProject.dll" does not exist.
4>Task "MakeDir"
4>Done executing task "MakeDir".
4>Task "AL"
4>  C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\AL.exe /culture:de /out:obj\Debug\de\MyProject.resources.dll /template:obj\Debug\MyProject.dll /embed:obj\Debug\MyProject.SomeResource.de.resources
4>  Microsoft (R) Assembly Linker version 14.0.0081.0
4>  Copyright (C) Microsoft Corporation. All rights reserved.
4>  
4>Done executing task "AL".
4>Done building target "GenerateSatelliteAssemblies" in project "MyProject.csproj".
4>Target "GenerateSatelliteAssemblies" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\source\MyProject.csproj" (target "CreateSatelliteAssemblies" depends on it):
4>Building target "GenerateSatelliteAssemblies" completely.
4>Output file "obj\Debug\en\MyProject.resources.dll" does not exist.
4>Task "MakeDir"
4>Done executing task "MakeDir".
4>Task "AL"
4>  C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\AL.exe /culture:en /out:obj\Debug\en\MyProject.resources.dll /template:obj\Debug\MyProject.dll /embed:obj\Debug\MyProject.SomeResource.en.resources
4>  Microsoft (R) Assembly Linker version 14.0.0081.0
4>  Copyright (C) Microsoft Corporation. All rights reserved.
4>  
4>ALINK : error AL1019: Metadata failure while creating assembly -- The volume for a file has been externally altered so that the opened file is no longer valid.
4>  The command exited with code 1.
4>Done executing task "AL" -- FAILED.
4>Done building target "GenerateSatelliteAssemblies" in project "MyProject.csproj" -- FAILED.

To me it is completely unclear what is meant by the error code AL1019. The MSDN error code listing didn't help either.

hessenmob82
  • 175
  • 12
  • 1
    The AL error code is not the root cause, "The volume for a file has been externally altered so that the opened file is no longer valid" is. It is an OS error (`ERROR_FILE_INVALID 1006 (0x3EE)`). For example, could be related to some external (removable) media being no longer available, or such. YMMV. – Christian.K Oct 04 '17 at 07:52
  • Are you using network resource for this? Is the source code on some shared driver or something? – Tarun Lalwani Oct 07 '17 at 09:44
  • The code is directly located on the system drive (c:), file access only happens on that drive during build (checked with Process Monitor - Sysinternals). – hessenmob82 Oct 09 '17 at 12:29
  • https://learn.microsoft.com/en-us/dotnet/framework/tools/al-exe-assembly-linker, In this website, you are missing /win32res. The url should help but not completely fix it :/ –  Oct 10 '17 at 14:08
  • 1
    Since the error is coming effectively from Windows or the file system, you should see whether it occurs on other machines as well, and you could take a look at the event log whether something strange happened at the same time that Windows noticed. As @Christian.K mentions, the underlying cause has nothing to do with AL. The linker gets that error from the OS and effectively rethrows it as its own. Consider AL1019 as »Something went wrong when trying to write the file and I don't really know what.«. A prime suspect would also be AV software, as those can interfere with builds all the time. – Joey Oct 11 '17 at 05:51
  • In the end it seems that the anti-virus software was the culprit. After some weeks the problem went away without changing Visual Studio, msbuild etc. – hessenmob82 Feb 21 '19 at 17:32

0 Answers0