visual-studio 在调试一个项目时阻止 Visual Studio 构建所有项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/734573/
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 10:21:36  来源:igfitidea点击:

Preventing Visual Studio from building all projects when debugging one

visual-studio

提问by Mike_G

I have a solution with a few different projects in it: a couple dll projects, a console project, and a couple WCF projects.

我有一个包含几个不同项目的解决方案:几个 dll 项目、一个控制台项目和几个 WCF 项目。

The console project uses a dll from one of the projects, but I have VS set so that the console project has no dependencies. However, when I debug the console project VS launches, or builds all my projects. This is just a pain since both the WCF projects compile and launch the WCF client or the asp.net dev IIS process. Is there a way to prevent this behavior?

控制台项目使用其中一个项目中的 dll,但我设置了 VS,因此控制台项目没有依赖项。但是,当我调试控制台项目 VS 启动或构建我的所有项目时。这只是一个痛苦,因为 WCF 项目编译并启动 WCF 客户端或 asp.net dev IIS 进程。有没有办法防止这种行为?

EDIT: I have semi fixed it. To prevent the WCF library from launching, I followed this: How to Prevent Visual Studio launch WcfSvcHost.exe in Debuggin?

编辑:我已经半修复了它。为了防止 WCF 库启动,我遵循了这个:如何在 Debuggin 中防止 Visual Studio 启动 WcfSvcHost.exe?

But I still cant stop the asp.net dev server from launching.

但我仍然无法阻止 asp.net 开发服务器的启动。

回答by Darin Dimitrov

Right click on your solution, then go to Properties, Configuration Properties and select the projects you want to be compiled.

右键单击您的解决方案,然后转到“属性”、“配置属性”并选择要编译的项目。

回答by Andy

You might try checking what Visual Studio builds when running a project. Open the Options dialog, and go to Projects and Solutions | Build and Run. Try turning on "Only build startup projects and dependencies on Run".

您可以尝试在运行项目时检查 Visual Studio 生成的内容。打开选项对话框,然后转到项目和解决方案 | 构建和运行。尝试打开“仅在 Run 上构建启动项目和依赖项”。

回答by womp

To stop the ASP.Net dev server from launching:

要停止启动 ASP.Net 开发服务器:

Simply click the web project in the solution explorer and hit F4 to bring up the properties window, and change "Always start when debugging" from "True" to "False". You might need to check all the projects in the solution.

只需单击解决方案资源管理器中的 Web 项目,然后按 F4 即可调出属性窗口,并将“调试时始终启动”从“真”更改为“假”。您可能需要检查解决方案中的所有项目。

See this threadfor more on this.

有关更多信息,请参阅此线程

回答by NickLeach

Just Unload The Project, Right Click Project -> Unload Project

只需卸载项目,右键单击项目 -> 卸载项目