Visual Studio Just-In-Time Debugger not finding already open instances
Asked Answered
F

3

12

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();
}

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.

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.

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?

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

Footstall answered 11/12, 2014 at 15:32 Comment(5)
My crystal ball says that your VS instance is running elevated.Picklock
@HansPassant Checked in process explorer and all instances are running at "Medium" integrity level. Also, the instances spawned by the Just-In-Time Debugger window don't show up in subsequent runs.Footstall
A full reboot "fixed" it, but still no idea what caused it in the first place. Edited the question to include this new (but not shocking) developmentFootstall
@HansPassant Incidentally, I am running into this as well trying to debug an old BHO project. Any more ideas? I am running VS2010 as Admin but this was never a problem before... see hereAxinomancy
Please accept https://mcmap.net/q/934969/-visual-studio-just-in-time-debugger-not-finding-already-open-instancesMyongmyopia
D
8

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

Deina answered 16/3, 2017 at 13:22 Comment(1)
This was my exact problemCithara
M
5

Please check if you have enabled the check boxes named 'Managed' and/or 'Native' in visual studio under:

Tools->Options->Debugging->Just-In-Time

I ran into this problem recently where i had accidentally disabled these check boxes. It may not be relevant to your problem as it is working after the reboot. I am just posting this so that others may find it helpful.

Misapprehend answered 9/3, 2017 at 10:32 Comment(0)
K
1

Apart from the two different answers already posted on this page, seems like this issue is having a (short) comeback. But in this time it's as a real bug in Visual Studio 2017 early versions.

Anyway - No need to panic, it's already fixed in Visual Studio 2017 Version 15.3 preview 2. Just make sure your'e using this version or higher.

See Source for more details.

Kristianson answered 8/3, 2018 at 12:34 Comment(2)
Vs2020: I accidently choose "New Instance" instead of open solution. Now the Open solutions do not show in the available debuggers list. Just brilliant Microsoft!Lintel
Same problem. @KenNetherland. I first tried to delete the solution scoped .vs folder, then git clean -xfd and then I was so annoyed that I deleted everything in "C:\Users\<user>\AppData\Local\Microsoft\VisualStudio". Guess what worked... The latter. When trying to delete the folder content, you may face lock issues, especially with privateregistry.bin, FOR WHATEVER REASON... In my case I retried several times until it finally succeeded. Et voilá, your instance is reappearing. :> btw: This deletes user settings. Take care.Waw

© 2022 - 2024 — McMap. All rights reserved.