Visual Studio:同时调试多个项目? [英] Visual Studio: debug multiple projects at the same time?

查看:786
本文介绍了Visual Studio:同时调试多个项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Visual Studio中同时调试多个项目?

Is it possible to debug multiple projects at the same time in Visual Studio?

我知道您可以从解决方案属性中选择多个启动项目,但是如何处理断点?

I know you can select multiple startup projects from the solutions properties, but how are the breakpoints handled?

如果两个项目使用相同的类(它的两个不同实例),而我在其中有一个断点而停下来,它将仅阻塞一个程序还是同时阻塞两个程序?我怎么知道哪个可执行文件达到断点?我有点困惑.

If two projects use the same class (two different instances of it), and I am stopped with a breakpoint in it, will it only block one program or both? How can I know which executable is hitting the breakpoint? I'm a bit confused.

推荐答案

是的,有可能.您可以在解决方案中设置多个启动项目(右键单击解决方案,转到设置启动项目,选择多个启动项目),然后为包含在其中的每个项目指定操作解决方案(启动无需调试即可启动).如果您将多个项目设置为开始,则调试器将在启动时附加到每个项目.

Yes, it is possible. You can set multiple startup projects in your solution (right-click solution, go to Set Startup Projects, choose Multiple startup projects), and specify the action for each project contained in the solution (None, Start, Start without debugging). If you have multiple projects set to Start, the debugger will attach to each one as it launches.

当您遇到断点时,您可以使用 Debug Location 工具栏查看您正在使用的进程(您可能必须显示它;某些配置文件默认将其隐藏).它将显示您当前正在查看的进程,正在使用的线程以及处于的堆栈框架:

When you hit a breakpoint, you can see which process you're in using the Debug Location toolbar (you may have to show it; some profiles hide this by default). It will show which process you're currently looking at, which thread you're on, and which stack frame you're in:

我相信默认行为是,当一个进程中断时,调试器将中断所有中断.这样,当您遇到单个断点时,您可以检查任何附加进程的状态.

I believe the default behavior is that when one process breaks, the debugger will break all of them. This way you can check the state of any attached process when you hit a single breakpoint.

这篇关于Visual Studio:同时调试多个项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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