在Visual Studio 2015 Update 1中从后构建事件执行AL.EXE时,错误-1073741819(0xC0000005) [英] Error -1073741819 (0xC0000005) when executing AL.EXE from Post-Build event in Visual Studio 2015 Update 1
问题描述
使用Visual Studio 2015更新1,我在Visual C ++ CLR类库项目(C ++ / CLI)中运行命令AL.EXE时在Post-构建事件:AL.EXE应用程序崩溃,系统返回错误代码-1073741819(0xC0000005)。
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
剪切事件查看器,显示AL.exe应用程序的错误,每次从后构建事件(编译我的项目)运行它。编译我的项目。
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).
命令行正确,您可以看到我是否从控制台执行它:
The command line is correctly as you can see if I execute it from a console:
所以我确定问题不是因为命令行。
So I'm sure the problem is not because the command line.
此外,我试图指定另一个AL.EXE命令的路径,因为Visual Studio 2015更新1使用路径:
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
所以我尝试使用
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools
但仍然无效。
您可以重现创建一个新的Visual C ++的CLR类库的问题,并添加一个简单的调用AL.exe在Post-构建事件。
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?
编辑:我也试着做使用AfterBuild目标如下:
I tried also to do it with an AfterBuild Target like this:
<Target Name="AfterBuild">
<Exec Command="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"/>
</Target>
结果是一样的:Visual Studio尝试运行命令AL.EXE,但它崩溃返回-1073741819。
And the result is the same: Visual Studio tries to run the command AL.EXE but it crashes returning -1073741819.
推荐答案
感谢 JaredPar
在nmake文件或
post build事件中调用al.exe之前添加以下行:
Add the following line before the call to al.exe in your nmake file or post build events
chcp 437
这将在运行
al.exe之前将控制台代码页重置为已知的值。
This will reset the console code page to a known value before running al.exe.
这篇关于在Visual Studio 2015 Update 1中从后构建事件执行AL.EXE时,错误-1073741819(0xC0000005)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!