Visual Studio 2010随机说,命令行更改,并重建 [英] Visual Studio 2010 randomly says the command line changed, and rebuilds

查看:168
本文介绍了Visual Studio 2010随机说,命令行更改,并重建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Studio有时决定重建我的整个巨大的项目,因为一个小的变化。我把构建日志转到Diagnostic,看看是什么问题,这是我看到的:

Visual Studio sometimes decides to rebuild my entire huge project because of one small change. I turned build logging up to Diagnostic to see what was the problem, and here's what I'm seeing:

< Bunch of spam >
Outputs for C:\<snip>\PRECOMPILEDHEADERS.CPP:
    C:\<snip>\PRECOMPILEDHEADERS.OBJ
All outputs are up-to-date.
Forcing rebuild of all source files due to a change in the command line

...然后它重建我的预编译头,然后一切。

... and then it rebuilds my precompiled headers, then everything else.

当我更改项目中的一个.cpp或.h文件时。我不改变任何项目设置。它也不会一直发生同样的变化;它是随机的。

This happens when I change a single .cpp or .h file inside the project. I'm not changing anything in the project settings. It also doesn't happen all the time for the same change; it's random.

这里有什么想法吗?在哪里可以获得更多信息?我尝试通过 http://blogs.msdn.com/b/vsproject/archive/2009/07/21/enable-c-project-system-logging.aspx ,但它没有提供任何更多的信息。我不知道这里由于命令行中的更改强制重建所有源文件是从哪里来的。它不是在任何工厂MSBuild文件。

Any ideas on what's going on here? Where can I get more information? I tried enabling debugging via the description in http://blogs.msdn.com/b/vsproject/archive/2009/07/21/enable-c-project-system-logging.aspx but it didn't give any more information. I can't figure out where this "Forcing rebuild of all source files due to a change in the command line" is coming from. It's not in any of the factory MSBuild files.

一些其他信息:这是一个C / C / CLI dll项目,链接了很多其他项目,包括C#,本机c +和其他C ++ / CLI DLL。我试图从依赖关系中删除所有的C#项目,因为那些往往会导致问题,但这并没有改变它。我已经google了这个特定的字符串,但我的情况不匹配任何其他人报告它。 (一个是使用Intel C ++,另一个是MSBuild从命令行更改的情况下,我从Visual Studio本身打的构建解决方案)。

Some other info: it's a C++/CLI dll project that links a lot of other projects, including C#, native c++, and other C++/CLI dll's. I tried removing all the C# projects from the dependencies since those tend to cause problems, but that didn't change it. I've googled that specific string, but my situation doesn't match that of any of the other people reporting it. (One was using Intel C++, another was MSBuild from the command line and changing the case. I'm hitting build solution from within Visual Studio itself).

编辑解释常见修复我试过:

Edit to explain common fixes I've tried:

我已经尝试只构建项目。同样的事情。

I've tried building only the project. Does the same thing.

我不包括任何不存在的.h文件。

I'm not including any .h files that don't exist.

我删除了bin /对象文件夹,并从头开始重建。

I've deleted the bin/object folders and rebuilt from scratch. This usually makes it go away for a couple builds, but then it comes right back.

编辑#2:

在日志中发现可疑的东西:

Found something suspicious earlier in the log:

3>Using "ResolveNonMSBuildProjectOutput" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
3>Task "ResolveNonMSBuildProjectOutput"
3>  Resolving project reference "..\..\..\..\CommonCore\VS2010\Project1\Project1.vcxproj".
3>  Project reference "..\..\..\..\CommonCore\VS2010\Project1\Project1.vcxproj" has not been resolved.

这是对我的几个项目重复的...我要追逐下来,可能是项目引用提示路径的问题。

This is repeated for several of my projects... I'm gonna chase that down and see if maybe it's a problem with the project reference hint paths.

推荐答案

我做了三件事,问题似乎已经消失了。我想缩小一点,但我想我会继续前进并发布他们:

I did three things, and the problem seems to have gone away. I'm trying to narrow it down a little but I figured I'd go ahead and post them:


  • 删除并重新添加所有引用和项目引用

  • 修复了我的一个项目,没有将.NET框架目标设置为3.5,以匹配我的解决方案的其余部分(我是远离它,因为项目

  • 将所有引用(包括系统引用)设置为复制本地卫星程序集为false。

请注意,这些东西的一些或全部可能是巫术的...

Beware that some or all of this stuff might be voodoo...

这篇关于Visual Studio 2010随机说,命令行更改,并重建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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