Visual Studio 不断构建一切

发布于 2024-09-05 04:31:39 字数 104 浏览 9 评论 0原文

我有一个包含许多项目的大型 .sln 文件。

我刚刚对项目 A 进行了更改,它构建了项目 A 引用的其他九个项目,但没有代码更改。

有什么技巧可以加快这个过程吗?

I have a large .sln file with many projects.

I just made a change in project A and it builds nine other projects that project A references, but that had no code change.

Is there a trick to speed this process up?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

长不大的小祸害 2024-09-12 04:31:39

分而治之:通过创建包含您正在处理的项目的逻辑子集的其他解决方案,限制解决方案中持续的构建时间。这会限制您的范围并加快构建速度。

请参阅此 MSDN 文章中的分区单一解决方案模型http://msdn.microsoft.com/en-us/library/ee817674.aspx

文章的关键引用:

Separate solution files allow you to work on smaller subsystems within your overall system 
but retain the key benefits of project references. Within each subsolution file, 
project references are used between constituent projects.

Divide and conquer: Limit the amount of build time that goes on in your solution by creating additional solutions that contain logical subsets of projects you're working on. This limits your scope and will speed up builds.

See the The Partitioned Single Solution Model in this MSDN article: http://msdn.microsoft.com/en-us/library/ee817674.aspx

Key quote from the article:

Separate solution files allow you to work on smaller subsystems within your overall system 
but retain the key benefits of project references. Within each subsolution file, 
project references are used between constituent projects.
寒尘 2024-09-12 04:31:39

当项目有一个并不真正存在的文件时,就会发生这种情况。
项目无法确定文件是否已更改(因为它不存在),因此需要重建。

只需查看项目中的所有文件,然后搜索附近没有可展开箭头的文件即可。

This happens when a project has a file that doesn't really exist.
The project can't determine if the file was changed (because it's not there) so it rebuilds.

Simply look at all the files in the project, and search for the one that doesn't have an expandable arrow near it.

抚笙 2024-09-12 04:31:39

将构建输出的详细程度更改为详细,然后查看顶部的内容。就我而言,它告诉我由于文件丢失,该项目不是最新的。

Change the build output verbosity to detailed and see what it says at the top. In my case, it told me the project wasn't up to date because of a file that was missing.

游魂 2024-09-12 04:31:39

右键单击项目 A 时选择“仅构建”应该可以解决问题。我不确定在构建解决方案时是否有办法阻止它构建引用的项目(这就是标准“构建”命令的作用)。

Selecting 'build only' when right-clicking the project A should do the trick. I am not sure if there is a way to keep it from building referenced projects as well when building the solution (which is what the standard 'build' command does).

追我者格杀勿论 2024-09-12 04:31:39

确保您的项目依赖关系正确。右键单击该项目并转到“项目依赖项”。确保每个项目仅依赖于链接所需的最少其他项目集。

Make sure your project dependencies are correct. Right click on the project and go to "Project Dependencies." Make sure that each project only depends on the minimal set of other projects that are needed to link.

北方的巷 2024-09-12 04:31:39

另一件需要注意的事情是,因为它刚刚发生在我身上,如果您使用 ClearCase 当您的解决方案打开并且部分代码已通过同步更新时,它有时会错误地在文件上设置时间戳,因此它会一直认为您的源文件已被修改并每次都编译您的项目。

为了解决这个问题,我必须关闭解决方案并再次重新打开它,它的行为符合预期。

Another thing to look for, because it just happened to me, is that if you synchronise your view using ClearCase while your solution is open and some of your code was updated by the synch, it sometimes sets the timestamps incorrectly on the files, so it keeps thinking your source files have been modified and compiling your project every time.

To fix this I had to close the solution and reopen it again, and it behaved as expected.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文