本文介绍了MSBuild-错误MSB3073:“退出,代码为-1.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在VS2010的make项目中使用批处理文件.

I am trying to use a batch file in a make project in VS2010.

该批处理文件启动了各种内部工具,其中一些工具是用Perl 5.8.8编写的.

The batch file launches various internal tools some of which are writing in Perl 5.8.8.

批处理文件构建成功后,我总是会看到代码-1退出".

I always see the 'exited with code -1' when the batch file build is successful.

我添加了检查%errorlevel%的代码,当MSBuild返回以代码-1退出"时,它返回0.

I added code to examine %errorlevel% and it returns 0 when MSBuild returns 'exited with code -1'.

  • 因此显式设置错误级别无济于事.
  • 用setlocal和endlocal包围批处理文件无济于事.

MSBuild环境在哪里获得-1值?

Where is the MSBuild environment getting the -1 value?

1)如何覆盖此值,以使MSBuild不会显示错误.

1) How can I override this value so MSBuild does not display the error.

顺便说一句:错误始终显示构建命令行"字段的全部内容,在我看来,这很长.

BTW: the error always displays the entire contents of the 'Build Command Line' field which is lengthy in my case.

2)我也该如何抑制呢?

2) How can I suppress this too?

谢谢

J.R.

推荐答案

我正在尝试重现此问题,以使我无法理解正在发生的事情,在这里分享更多信息该怎么办?

I'm trying to reproduce this issue so that I can unstand what is happening, what about share some more info here?

1.这里的make项目是什么,请澄清一下,您的意思是C ++中的nmake吗?
https://msdn.microsoft.com/en-us/library/dd9y37ha.aspx

1. What is make project here, please clarify it, do you mean the nmake in C++?
https://msdn.microsoft.com/en-us/library/dd9y37ha.aspx

2.该批处理文件是什么?该批处理文件与项目之间的关系是什么?

2. What is that batch file and what is the relationship of that batch file and the project?

3.错误级别似乎与%errorlevel%不同,您对此有任何环境吗?为什么说这是因为我看了这篇文章:

3. The errorlevel seems different from %errorlevel%, do you have any environment about this? Why I say this is beacuase I saw this article:

http://blogs.msdn.com/b/oldnewthing/archive /2008/09/26/8965755.aspx

由于我不确定您的工作方式,因此我认为我们可能需要使用记录仪来查看是否可以获得一些信息:

Since I'm not sure how you did this job, I think we may need to use logger to see if we can get some info:

https://msdn.microsoft.com/en-us/library/ms171470.aspx

最诚挚的问候,


这篇关于MSBuild-错误MSB3073:“退出,代码为-1.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 14:01