通过Visual Studio中的不同解决方案进行调试 [英] Debugging Through different solutions in Visual Studio

查看:159
本文介绍了通过Visual Studio中的不同解决方案进行调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我有一个解决方案A,其中包含一个域层基础和解决方案B,它引用了解决方案A中的二进制文件。有没有办法通过两个可视化工作室实例(一个针对每个解决方案)从一个对象直接调试)。我已经读过,你可以将现有项目从解决方案A添加到解决方案B.还有其他的解决方案有效吗?我已经尝试直接将解决方案A附加到解决方案B中正在运行的可执行文件,但它不会让我将多个调试器附加到同一个应用程序。



我应该注意,当我进入一个它自动从解决方案A中的解决方案A的代码自动提出Visual Studio的实例进行调试。我想这是可以接受,但你不能只是设置任意的断点,等待代码以这种方式命中。



谢谢

解决方案

没有办法让Visual Studio的2个实例调试相同的过程。这是Windows的限制,大多数其他操作系统最多只能调试一个进程。



这是一个完全支持的方案,但是调试不是解决方案一部分的二进制文件。正如你所注意到的那样,从解决方案A调试时,您可以从解决方案B中快乐地进入二进制文件。



一个可以解决方案的项目是调试功能命名为Just My Code。这是一个功能,旨在最大限度地减少调试体验,只需解决方案中的代码。很适合正常的解决方案,但是当你调试任意的二进制文件时,这是很糟糕的。这可能会导致您遇到的突破点的很多问题。您需要通过执行以下操作来禁用它:


  • 工具 - >选项 - >调试

  • 未选中启用我的代码


Currently I have solution A that contains a domain layer base and solution B that references the binaries from solution A. Is there a way to debug straight through from one to the other with two instances of visual studio open (one for each solution). I've read that you can just add the existing projects from solution A to solution B. Is there any other solution that works? I've tried directly attaching solution A to what the running executable in solution B but it won't let me attach multiple debuggers to the same app.

I should note that when I step into a piece of it automatically brings up the code from solution A within solution B's instance of Visual studio to debug in. I suppose this is acceptable, but you can't just set arbitrary breakpoints and wait for the code to hit them this way.

Thanks

解决方案

There is no way to have 2 instances of Visual Studio debugging the same process. This is a limitation of Windows, and most other operating systems in that at most one process can be debugging another.

It is a perfectly supported scenario though to debug binaries that are not a part of your solution. As you've noted you can happily step into binaries from Solution B while debugging from a Solution A.

One item that will get in the way here though is the Debugging feature named "Just My Code". This is a feature aimed at minimizing the debugging experience to just the code in your solution. Great for normal solutions but bad when you're debugging arbitrary binaries. It's likely causing a lot of the problems around break points you're seeing. You'll want to disable it by doing the following

  • Tools -> Options -> Debugging
  • Unchecked "Enable Just My Code"

这篇关于通过Visual Studio中的不同解决方案进行调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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