您如何防止构建未更改的项目? [英] How do you prevent building of unchanged projects?

查看:102
本文介绍了您如何防止构建未更改的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:VS 2008 9.0.30729.4108 QFE,C#

我有一个包含46个项目的解决方案.构建后,无需重新构建Visual Studio,我可以运行任意次数.如果我只在一个类中插入一个空格字符,然后保存该文件并按F5键,它将开始构建并 最后给我这个:

===========内部版本:32个成功,0个失败,8个最新,跳过0个==========

为什么?可以预防吗?对于具有空格符的一个项目需要重建,我并不感到惊讶,但是为什么所有32个依赖或间接依赖于已更改项目的项目(我假设这些依赖项 是什么原因?)

基于下面提到的帖子,我先构建了Diagnostic输出(300,000行),然后进行了详细说明.第二个仍然有43,500行.我不确定要寻找什么来确定为什么要构建这32个项目.

我不认为在在构建中,仅构建已更改的项目"之类的地方有个不错的选择???

以下是一个相关链接,但并未完全回答该问题,如果可能的话,我将不胜感激.
http://social.msdn.microsoft.com/forums/zh-CN/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed

谢谢

解决方案

Usablilitytank,

感谢您的信息.

根据我的理解,这32个项目依赖于或间接依赖于此文件,编译器可以将输入文件的时间戳与输出文件的时间戳进行比较,并确定是跳过还是构建.作为 弗兰克说,在您发布的线程中,F5进行的是构建而不是重新构建,如果项目或引用已更新,则它将进行构建.因此,我认为不能避免不构建这些项目,或者在构建解决方案时不会更新参考.

在Visual Studio中,当项目过期时,有一种方法可以设置为永不构建 运行时(F5),当您单击F5时,没有构建项目配置.为此,请设置 下的项目过期时,永远不要运行构建 工具>选项>建立并运行>在运行时,当项目过期时.但是此方法的缺点是直接运行(F5)时,任何项目中的更新都不会更新,您需要手动构建此解决方案才能应用此方法 在Visual Studio中更新.

如果我误解了您,或者您有任何意见,请告诉我.

注意,

南希邵[MSFT]
MSDN订阅者支持 解决方案

Hi Usablilitytank,

Thanks for your post.

Based on my understanding, these 32 projects are dependent or indirectly dependent on this file,  the compiler can compare the timestamps of the input files with the timestamps of the output files and determine whether to skip or build. As Frank says in the thread you post, F5 does a build not a rebuild, it will build if the projects or references have been updated. So I think it can't aviod not to build these projects or references have been updated when build solution.

There is a method to set to Never Build on Run (F5), when projects are out of date in Visual Studio, when you click F5, out of date project configuration is not built. To do this, set Never Build on Run, when projects are out of date under Tools > Options > Build and Run > On Run, when Projects are out of date. But a disadvantage of this method is update in any projects does not update when you directly run( F5), you need to manually Build this solution to apply this update in Visual Studio.

If I misunderstood you, or you have any comments, please let me know.

Regards,

Nancy Shao [MSFT]
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg @ microsoft.com


这篇关于您如何防止构建未更改的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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