Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 392
Harrison Paine Avatar asked Dec 11 '14 15:12

Harrison Paine


People also ask

How do I fix No registered JIT debugger was specified?

Please disable your JIT debugging in your side. Note: You need to run your VS as the admin. One possible reason is that it has the crashed or unhanded exception in your side which leads to pop-up the JIT debugging. So you need to disable JIT debugging and find the real reason in your side.

When JIT debugging is enabled any unhandled exception will be sent to the JIT debugger?

The application must also be compiled with debugging enabled. When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box."


3 Answers

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.

like image 63
Guru HG Avatar answered Oct 18 '22 23:10

Guru HG


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

like image 24
mattalxndr Avatar answered Oct 18 '22 23:10

mattalxndr


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.

like image 1
itsho Avatar answered Oct 18 '22 23:10

itsho