visual-studio 在 Visual Studio 中同时运行两个项目

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

Running two projects at once in Visual Studio

visual-studiovisual-studio-2010visual-studio-2015

提问by Tim Cooper

I created a solution in Visual C# 2010 Express that contains two projects: one is the client, the other is the server. I would like to debug both at the same time, but I can only seem to run one of the projects during debugging.

我在 Visual C# 2010 Express 中创建了一个解决方案,其中包含两个项目:一个是客户端,另一个是服务器。我想同时调试两者,但在调试期间我似乎只能运行其中一个项目。

Is there a way to run both at once?

有没有办法同时运行两者?

回答by Max

Go to Solution properties → Common PropertiesStartup Projectand select Multiple startup projects.

转到解决方案属性 →通用属性启动项目并选择多个启动项目

Solution properties dialog

解决方案属性对话框

回答by Kevin

Max hasthe best solution for when you always want to start both projects, but you can also right click a project and choose menu DebugStart New Instance.

当您总是想启动两个项目时,Max 有最好的解决方案,但您也可以右键单击一个项目并选择菜单DebugStart New Instance

This is an option when you only occasionally need to start the second project or when you need to delay the start of the second project (maybe the server needs to get up and running before the client tries to connect, or something).

当您只是偶尔需要启动第二个项目或需要延迟启动第二个项目时,这是一个选项(可能服务器需要在客户端尝试连接之前启动并运行,等等)。