I've noticed in recent months that the Just in Time debugging feature
doesn't seem to work any more. For example, I compile and run a debug build
of my code. A crash occurs, and I get the "YouApp has encountered a problem
and needs to close." dialog. I click the Debug button and the dialog appears
again. I click the Debug button again, and the app just closes.
I never get a prompt to select the current or new instance of VS and never
get into the debugger.
I thought maybe the JIT settings for VS had become corrupt so I went into
the VS options>>debugging>>JIT and turned off JIT support, exited, came back
in and turned it back on.
This didn't help. Any ideas what would prevent VS JIT from triggering? Is
there some other technique to tell VS to re-assert itself as the JIT debugger
and perform the necessary machine config to get this working again?
What do you see in the registry under these keys?:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\win.ini [AeDebug value]
> What do you see in the registry under these keys?:
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\win.ini [AeDebug value]
For the AeDebug key I get the below (exported to .reg file):
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug]
"Auto"="1"
"Debugger"="\"C:\\WINDOWS\\system32\\VSJitDebugger.exe\" -p %ld -e %ld"
"UserDebuggerHotKey"=dword:00000000
For the win.ini key (AeDebug value) I get the below:
SYS:Microsoft\Windows NT\CurrentVersion\AeDebug
"Gerard O'Brien" wrote:
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug
> is the entry that is used for JIT when the process is a 64bit native
> process, and HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows
> NT\CurrentVersion\AeDebug is the entry that is used for JIT when the
> process is a 32bit process.
>
> On my system, currently, these have the following values<br>
>
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> NT\CurrentVersion\AeDebug]<br>
> "Auto"="1"<br>
> "Debugger"="\"C:\\Windows\\system32\\VSJitDebugger.exe\" -p %ld -e %ld"
>
> and
>
> [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows
> NT\CurrentVersion\AeDebug]<br>
> "Debugger"="\"C:\\Windows\\system32\\VSJitDebugger.exe\" -p %ld -e %ld"
> "Auto"="1"
>
> There are times when I have the 64bit JIT set to the 64bit windbg
> installation and the 32bit JIT set to the 32bit windbg installation
> (they happily coexist).
>
I checked the Wow6432Node and it was the same, except "Auto" was set to "0".
I changed it to "1", but it made no difference. When my app crashes, I get
the dialog, click Debug, get the dialog again, click Debug again, and the app
then just exits and never even attempts to go to the debugger as far as I can
tell.
I'm now of the opinion that Visual Studio itself is also throwing an exception when trying to launch it as the debugger, thus the
second debug popup and subsequent failure to launch the debugger.
Have you tried using WinDbg (at least temporarily) to see if it will launch as the "JIT debugger" (put it into the AeDebug keys)?