在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)。
这里的后构建事件的内容:
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应用程序时显示AL.exe应用程序错误的事件查看器。
命令行正确,您可以看到是否从控制台执行它:
所以我确定问题不是因为命令行。
此外,我尝试指定另一个AL.EXE命令的路径,因为Visual Studio 2015 Update 1使用以下路径:
C:\Program Files(x86)\Microsoft SDKs\Windows \v10.0A\bin\NETFX 4.6.1工具
所以我尝试使用
C: \\ Program Files(x86)\Microsoft SDKs \Windows \v8.1A\bin\NETFX 4.5.1工具
但仍然无法工作。
您可以重现创建一个新的Visual C ++的CLR类库的问题,并添加一个简单的调用AL.exe修改后的活动。
您是否知道如何解决这个问题?
使用AfterBuild目标像这样:
< 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。
解决方案感谢 JaredPar
在nmake文件或
post build事件中调用al.exe之前添加以下行:
chcp 437
这将在运行
al.exe之前将控制台代码页重置为已知的值。
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).
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.
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:"$(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>
And the result is the same: Visual Studio tries to run the command AL.EXE but it crashes returning -1073741819.
解决方案Thanks to JaredPar for the work around
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.
这篇关于在Visual Studio 2015 Update 1中从后构建事件执行AL.EXE时,错误-1073741819(0xC0000005)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!