VS 2015:更改解决方案配置会导致所有项目依赖项项目重新生成 [英] VS 2015: Changing Solution Configuration causes all project dependency projects to rebuild

查看:428
本文介绍了VS 2015:更改解决方案配置会导致所有项目依赖项项目重新生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VS 2015(14.0.25431.01 Update 3)中,我注意到,当我选择其他解决方案配置(即调试到发布")时,所有依赖于该解决方案中其他项目的项目解决方案构建后将重新构建. 我发现这是因为VS将build.force文件放在依赖于另一个项目的所有项目obj \ $(Configuration)文件夹中.

With VS 2015 (14.0.25431.01 Update 3) I've noticed that when I select a different solution configuration (i.e. Debug to Release), all projects that have a dependency to another project in the solution will be rebuilt when the solution is built.  I have found this is because VS in putting a build.force file in all the project obj\$(Configuration) folders that are dependent on another project.

可以通过创建一个新的解决方案并向其中添加2个新项目(Project1,Project2)来重新创建此行为.在Project2中,添加对Project1的项目引用.在Debug中构建解决方案,导致两个项目都建立.改变 解决方案配置中,先发布,然后再进行调试.构建解决方案,即使两个项目中的任何内容都没有更改,Project2也会重新构建.通过在Project2 \ obj \ Debug上打开资源管理器,可以观察到build.force文件. 然后在VS中将解决方案配置切换到Release,然后返回到Debug.

This behavior can be recreated by creating a new solution and adding 2 new projects (Project1, Project2) to it.  In Project2 add a project reference to Project1.  Build the solution in Debug causing both project to build.  Change the solution configuration to Release and then back Debug.  Build the solution and Project2 will rebuild even though nothing has been changed in either project.  The build.force file can be observed by opening an Explorer on Project2\obj\Debug and then in VS toggling the solution configuration to Release and then back to Debug.

推荐答案

感谢您在MSDN论坛中发帖.

您的帖子标题:

>>>>>>>>>>>>>>>>>>>>>>>>>

我在VS 2015社区上进行了测试,结果与您的相同.

这是我的步骤:

步骤1.在相同的解决方案下创建ConsoleApplication A和ConsoleApplication B,将AppB添加为对AppA的引用.

 在Debug模式下构建解决方案,请首先查看bin文件夹:

第2步:将Debug更改为Release,然后重新构建.

第3步:删除 AppA和AppB的bin \ Debug .

Step 3: Delete the files under the bin\Debug of AppA and AppB.

第4步:将Release切换到Debug并重新构建,bin文件夹与以前相同,这意味着即使没有任何变化,在更改配置后,引用也会重新生成.

如果您不需要构建已引用的项目,则可以转到Configuration Manager取消选中构建选项,然后重新构建:

如有任何疑问,请随时告诉我.

最好的问候,


这篇关于VS 2015:更改解决方案配置会导致所有项目依赖项项目重新生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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