Visual Studio 2010 在调用 msbuild 之前会做什么?
我遇到了 Visual Studio 未调用 msbuild 来实际构建我的解决方案的问题。从命令行调用 msbuild 会产生正确的构建,但在 Visual Studio 中启动构建会产生“一切都是最新的”消息。手动编译 .cpp 文件似乎可以部分或完全解决该问题。
重新启动 VS2010 并不能解决问题,所以我觉得 VS2010 一定在某个地方写入了自己的依赖信息。我所说的依赖信息是指实际需要构建哪些文件,也就是自上次成功构建以来哪些文件已被更改。
VS2010在调用msbuild之前是否执行它自己的依赖性检查?它在哪里存储这些信息?
I'm having a problem with Visual Studio not invoking msbuild to actually build my solution. Invoking msbuild from the commandline results in a proper build, but in Visual Studio starting build results in an "everything is up to date" message. Manually compiling a .cpp file seems to partially or fully fix the problem.
Restarting VS2010 does not correct the problem, so I feel like VS2010 must be writing its own dependency information somewhere. By dependency information I mean what files actually require building, AKA which files have been altered since the last successful build.
Does VS2010 perform it's own dependency checking before invoking msbuild? Where does it store this information?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要强制从 Visual Studio GUI 进行构建,您可以选择“全部重建”。这将触发所有源文件的编译。
常规版本无法运行的问题可能与 PC 中的时钟设置不正确有关。确保您的系统时钟正确,包括时区。然后做一个“干净”的项目并尝试再次构建。
To force a build to occur from the Visual Studio GUI you can select "Rebuild All". That will trigger compilation of all your source files.
The problem with regular builds not working could be related to incorrect clock settings in your PC. Make sure your system clock is correct, including the time zone. Then do a project 'clean' and try to build again.
我爸爸说检查你的“obj 文件夹”并将其清理掉。 VS2010 看到那里有东西,所以它假设没有什么新的东西可以构建。
My Dad says to check your "obj folder" and clean it out. VS2010 is seeing that there are things on there so it assumes there's nothing new to build.
我偶尔会看到这种行为,但我无法解释它是如何被破坏的。
尝试删除所有中间文件:
Debug
和Release
目录中的所有内容,以及类型为.suo
、的项目名称文件。 ncb
和.aps
。然后全部重建。如果您遇到与我相同的行为,这往往会使 VS 正常工作一段时间 - 几周或 50-100 次构建(以先到者为准)。
I've seen this kind of behavior occasionally, though I can't explain how it gets corrupted.
Try deleting all the intermediate files: everything in the
Debug
andRelease
directories, plus the project name files of types.suo
,.ncb
, and.aps
. Then rebuild all.If you are experiencing the same behavior as I do, this tends to make VS work properly for awhile—a few weeks or 50-100 builds (whichever comes first).