在 Visual Studio 中同时运行两个项目
我在 Visual C# 2010 Express 中创建了一个解决方案,其中包含两个项目:一个是客户端,另一个是服务器。我想同时调试这两个项目,但在调试过程中我似乎只能运行其中一个项目。
有没有办法同时运行两者?
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.
Is there a way to run both at once?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
转到解决方案属性 → 通用属性 → 启动项目,然后选择多个启动项目。
Go to Solution properties → Common Properties → Startup Project and select Multiple startup projects.
当您总是想启动这两个项目,但您也可以右键单击一个项目并选择菜单调试→启动新实例。
当您只是偶尔需要启动第二个项目或需要延迟启动第二个项目时(也许服务器需要在客户端尝试连接之前启动并运行,或者其他什么),这是一个选项。
Max has the best solution for when you always want to start both projects, but you can also right click a project and choose menu Debug → Start 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).
如果项目位于不同的解决方案中,您将无法在同一 Visual Studio 实例中运行它们。
我只是打开多个 Visual Studio 实例。在每个实例中,我都会打开我需要的不同项目(在不同的解决方案中)。
If the projects are in different solutions, you won't be able to run them in the same Visual Studio instance.
I just open multiple Visual Studio instances. In each instance, I open the different project (in a different solution) that I need.
在预览版
17.11.0 Preview 4.0
中,他们添加了创建配置文件以根据配置运行多个项目的功能,要启用它,只需工具 -> 即可。管理预览功能
现在您可以选择添加配置文件
根据您的项目设置配置
In the Preview version
17.11.0 Preview 4.0
they added the capability to create profiles to run multiple projects based on configuration, to enable it is toTools -> Manage Preview Features
now you have the option to add profiles
set up your configurations based on your project