Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Using Visual Studio 2015 Update 1, I'm experimenting a problem (that didn't happened with Visual Studio 2015) in a Visual C++ CLR class library project (C++/CLI) when running the command AL.EXE in Post-Build Event: The AL.EXE application crashed and the system returns the error code -1073741819 (0xC0000005).

Here the contents of the post-build event:

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 a snipping of the event viewer showing the error of the AL.exe application each time I run it from the post-build event (compiling my project).

enter image description here

The command line is correctly as you can see if I execute it from a console:

enter image description here

So I'm sure the problem is not because the command line.

Also I tried to specify the path to another AL.EXE command, because Visual Studio 2015 Update 1 uses the path:

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

So I tried with

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

but still not working.

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

Do you know how to solve this problem?

EDIT: I tried also to do it with an AfterBuild Target like this:

<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 command AL.EXE but it crashes returning -1073741819.

like image 420
joseangelmt Avatar asked Dec 02 '15 19:12

joseangelmt


1 Answers

Thanks to JaredPar for the work 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 the call to al.exe in your nmake file or post build events

chcp 437

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

like image 121
Daniel Kabzon Avatar answered Oct 06 '22 21:10

Daniel Kabzon