在 Visual Studio 2015 Update 1 中从 Post-Build 事件执行 AL.EXE 时出现错误 -1073741819 (0xC0000005) [英] Error -1073741819 (0xC0000005) when executing AL.EXE from Post-Build event in Visual Studio 2015 Update 1

查看:30
本文介绍了在 Visual Studio 2015 Update 1 中从 Post-Build 事件执行 AL.EXE 时出现错误 -1073741819 (0xC0000005)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Visual Studio 2015 Update 1,当在 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 Update 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 SDKsWindowsv10.0AinNETFX 4.6.1 Tools

所以我尝试了

C:Program Files (x86)Microsoft SDKsWindowsv8.1AinNETFX 4.5.1 Tools

但仍然无法正常工作.

您可以重现该问题,创建新的 Visual C++ 的 CLR 类库并在 Post-build 事件中添加对 AL.exe 的简单调用.

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 Target:

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>

结果是一样的: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 解决方法

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

在您的 nmake 文件中调用 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 中从 Post-Build 事件执行 AL.EXE 时出现错误 -1073741819 (0xC0000005)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆