visual-studio Visual Studio:如何仅构建一些项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1433657/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 11:01:26  来源:igfitidea点击:

Visual Studio: How to build only some projects

visual-studiovisual-studio-2008

提问by Yaron Naveh

My VS solution has many projects. I am currently only working on some of them so I want CTRL+SHIFT+B to only build some. What's the best way to do it?

我的 VS 解决方案有很多项目。我目前只处理其中的一些,所以我希望 CTRL+SHIFT+B 只构建一些。最好的方法是什么?

I thought about creating a new configuration but I would need to check it in and it does not seem right. I don't care if it will be only a "local" setting on my machine.

我想过创建一个新配置,但我需要将其签入,但似乎不对。我不在乎它是否只是我机器上的“本地”设置。

采纳答案by womp

Creating a new configuration would be the best way to do it.

创建新配置将是最好的方法。

Alternately, create a second solution file and only add the projects you're interested in. We've done that for a few of our enterprise products where a full solution would load dozens of projects. The main reason we did this is to cut down on the resources that VS uses. Name the solution something like "My Product - minimal build". You have the option of checking it in or not.

或者,创建第二个解决方案文件并仅添加您感兴趣的项目。我们已经为一些企业产品执行了此操作,其中完整的解决方案将加载数十个项目。我们这样做的主要原因是为了减少 VS 使用的资源。将解决方案命名为“我的产品 - 最小构建”。您可以选择是否签入。

回答by David

Right-click on the Solution and choose "Configuration Manager". Un-check the "Build" columns for each one you don't want built.

右键单击解决方案并选择“配置管理器”。取消选中您不想构建的每个列的“构建”列。

回答by sbi

Go to the solution explorer (CTRL+SHIFT+Lfor me), mark the projects you want to build, right-click them (SHIFT+F10if you are a keyboard aficionado) and select "Build Selection"

转到解决方案资源管理器(CTRL+SHIFT+L对我而言),标记要构建的项目,右键单击它们(SHIFT+F10如果您是键盘爱好者)并选择“构建选择”

回答by Syfer Polski

Look into the solution explorer - right click the projects you don't want to build and unload them

查看解决方案资源管理器 - 右键单击​​您不想构建和卸载的项目

回答by RonnieScotland

Simply right click on the project you want to build in Solution Explorer, and select Build. It will build that project only (including referenced projects).

只需在解决方案资源管理器中右键单击要构建的项目,然后选择构建。它将仅构建该项目(包括引用的项目)。