在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

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

问题描述

使用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:&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。

解决方案

感谢 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文件或
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:&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.

解决方案

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.

这篇关于在Visual Studio 2015 Update 1中从后构建事件执行AL.EXE时,错误-1073741819(0xC0000005)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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