Error -1073741819 (0xC0000005) when executing AL.EXE from a Post-Build event in Visual Studio 2015 Update 1

Using Visual Studio 2015 update 1, I am experimenting with a problem (which did not happen with Visual Studio 2015) in the Visual C ++ CLR Class Library Project (C ++ / CLI) when I run the AL.EXE command in Post- Build Event: AL Application .EXE crashed and the system returned error code -1073741819 (0xC0000005).

Here is the contents of the event after the build:

sn -Rca "$(SolutionDir)bin\$(Configuration)\$(Platform)\$(TargetName)$(TargetExt)" dwo Resgen "$(ProjectDir)Recursos.es-ES.resx" "$(IntDir)$(ProjectName).Recursos.es-ES.resources" Al.exe /t:lib /embed:"$(IntDir)$(ProjectName).Recursos.es-ES.resources",Recursos.es-ES.resources /version:15.0.0.0 /culture:es-ES /out:"$(OutDir)es-ES\$(TargetName).resources.dll" /keyname:dwo 

And here the event viewer is turned off, showing the AL.exe application error every time I run it from the event after the build (compiling my project).

enter image description here

The command line is correct, as you can see if I am executing it from the console:

enter image description here

Therefore, I am sure that the problem is not that on the command line.

I also tried to specify the path to another AL.EXE command, because in Visual Studio 2015 Update 1, the path is used:

 C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools 

So, I tried using

 C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools 

but still not working.

You can reproduce the problem of creating a new Visual C ++ CLR class library and adding a simple AL.exe call to the Post-build event.

Do you know how to solve this problem?

EDIT: I also tried to do this using the AfterBuild Target object as follows:

 <Target Name="AfterBuild"> <Exec Command="Al.exe /t:lib /embed:&quot;$(IntDir)$(ProjectName).Recursos.es-ES.resources&quot;,Recursos.es-ES.resources /version:15.0.0.0 /culture:es-ES /out:&quot;$(OutDir)es-ES\$(TargetName).resources.dll&quot; /keyname:dwo"/> </Target> 

And the result is the same: Visual Studio tries to run the AL.EXE command, but it resets the return -1073741819.

+5
source share
2 answers

Thanks to JaredPar for working around

http://blogs.msdn.com/b/bharry/archive/2015/11/30/vs-2015-update-1-and-tfs-2015-update-1-are-available.aspx?CommentPosted=true# 10659560

Add the following line before calling al.exe in the nmake file or post-build events

chcp 437

This will reset the console code page to a known value before running al.exe.

+4
source

I just ran into the same problem when trying to create an ASP.NET project.

al.exe error message

1> C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Community \ MSBuild \ 15.0 \ Bin \ Microsoft.Common.CurrentVersion.targets (3441.5): MSB6006 error: "al.exe" exited with code - 1073741819.

This will happen after you change the default Codepage in the default console window properties: DefaultsDefault code page

Just return it to 437 and the problem is gone.

0
source

Source: https://habr.com/ru/post/1237277/


All Articles