调试多个解决方案VS 2012 [英] Debug Multiple Solutions VS 2012

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

问题描述

我一直在尝试使用解决方案B中的MVC项目调试解决方案A中的类库.我运行解决方案B,在解决方案A中设置一个断点,但是调试器永远不会进入解决方案A.

I have been trying to debug a class library in a Solution A with a MVC project in Solution B. I run Solution B, set a breakpoint in Solution A, but the debugger never gets into Solution A.

我已经尝试使用此答案此答案没有成功.

I have already tried with this answer and this answer with no success.

如何在VS2012中调试多个解决方案?

How can I debug multiple Solutions in VS2012?

谢谢!

推荐答案

有一些方法可以做到这一点.但最简单的方法是:

There are some ways to do this. But the easiest would be:

  1. 启动解决方案B
  2. 转到解决方案A
  3. 转到调试"->附加到处理程序..."
  4. 选择正在运行的可执行文件(当然,从解决方案B.您可能需要选中显示所有用户的进程")

您需要将解决方案A链接到解决方案B的可调试版本,此功能才能起作用.通常它在项目的 bin \ Debug 子目录中.在这种情况下,应该在达到断点后立即击中它.

You need to link your Solution A to Solution B's debuggable version for this to work. Usually it's in the bin\Debug subdirectory of your project. In that case, your Breakpoint should be hit as soon as it's reached.

另一种方式是:

  1. 打开解决方案A的属性.
  2. 转到调试
  3. 在开始操作"下,选择启动外部程序:"
  4. 浏览解决方案B的可执行文件

运行解决方案A.

另一种方法是将句子 Debugger.Break(); (这需要使用System.Diagnostics; )插入到类库中.但是请注意不要发布调试版本!达到目标后,系统应立即弹出一个对话框,询问您是否要调试该过程.此过程还取决于所有组件的正确安装...

Yet another way would be to insert into your class library the sentence Debugger.Break(); (which requires using System.Diagnostics;). Be careful to not release the debug version, though! As soon as it's reached, the System should throw up a dialog box asking if you'd like to debug the process. This process depends on the correct installation of all components as well...

这篇关于调试多个解决方案VS 2012的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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