Visual Studio 即时调试器找不到已打开的实例 [英] Visual Studio Just-In-Time Debugger not finding already open instances

查看:25
本文介绍了Visual Studio 即时调试器找不到已打开的实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由外部程序调用的 C# 控制台应用程序,该程序为其提供命令行参数.为了便于调试,我创建了一个条件方法,我立即在 Main() 中调用它:

I have a C# console application program that is called by an external program which provides it with its command line parameters. In order to ease debugging, I've created a conditional method which I call immediately in Main():

[System.Diagnostics.Conditional("DEBUG")]
static void BreakIfInDebugMode()
{
    System.Diagnostics.Debugger.Break();
}

在外部程序中,当我要调试时,将外部调用指向我的.exe的bin\Debug位置,弹出Visual Studio Just-In-Time Debugger窗口,然后我选择了我当前用于开发的 Visual Studio 实例.

In the external program, when I want to debug, I point the external call to the bin\Debug location of my .exe, the Visual Studio Just-In-Time Debugger window pops up, and I select the instance of Visual Studio that I'm currently using to do development.

除此之外,从今天开始,当前正在运行的 Visual Studio 实例不会出现.我只能选择启动一个新实例.即使我通过调试器提示启动的新实例在我让它运行时也不会显示.这是一个巨大的麻烦,因为我已经有一个正在运行的实例并且项目已经打开,并且已经在我想要调试的代码周围设置了断点.

Except, starting today, currently running instances of Visual Studio are not appearing. I only get the option to start a new instance. Even the new instance I launch through the Debugger prompt doesn't show up when I leave it running. This is a huge hassle, since I have an already running instance with the project open, and breakpoints already set around the code I want to debug.

我注意到从关闭程序/调试程序"到选择 Visual Studio 对话框的实例"所需的时间比平时长.为什么调试器选择找不到我已经在运行的调试器的任何解决方案?

I have noticed that it takes a longer than usual time from the "Close the program/Debug the program" to the "Select an instance of Visual Studio dialog". Any solutions for why the debugger selection is not finding my already running debuggers?

执行重新启动后,预期行为已恢复.通过不太激烈的措施进行修复仍然会很好.

After performing a reboot, the expected behavior was restored. It would still be nice to fix via less drastic measures.

推荐答案

也许进程以管理员身份运行,而 VS 不是.这是我的问题.

Perhaps the process is running as admin, and VS is not. This was my problem.

这篇关于Visual Studio 即时调试器找不到已打开的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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