Debugger.Launch not working

I am currently trying to run a debugger for a process that is being launched externally (not from visual studio). It seems I can’t actually start the debugger, as it seems like nothing is happening. In this process, I added this code:

Debug.Assert(Debugger.IsAttached == false, "Should be no debugger");
if (!Debugger.IsAttached)
{
    Debug.Assert(Debugger.Launch(), "Debugger not launched");
}
Debugger.Break();
Debug.Assert(Debugger.IsAttached == true, "Debugger should be attached");

The allegations are there to make sure I'm not crazy. The IsAttached property first returns false, as I expect. Then I call Debugger.Launch and returns true . According to the MSDN documentation for Debugger.Launch, he says that he will return true only if he manages to start the debugger or if it is already connected. I confirmed that one of them was not attached, so he had to start it.

A breakpoint never hits, and the second check fails (the IsAttached property returns false). I also tried falling asleep after Debugger.Launch to give it some time, to no avail.

Any suggestions?

+7
source share
4 answers

Answer: Visual Studio 2010 Express

Express does not support (without the level of hacking) associated with the process of debugging it. This means that the Just In Time debugging features are not available. I assume this also causes Debugger.Launch to fail (although it returns true, and I assume that since it was technically trying to show a dialog, but no debugs have been set).

0
source

Visual Studio 2013 Premium. , . .

  • β†’ β†’
  • , . , "Just In Time" VS - .

.!

+11

, VS Express , VS2013 Pro.

, , VS2013, VS2013, , , . , . .

, , , .

: AppIDFlags Just-In-Time Debugger Visual Studio 0x28 0x8 ( 0x20 , ). HKEY_CLASSES_ROOT\AppID\{E62A7A31-6025-408E-87F6-81AEB0DC9347}

+3

Perhaps this will help someone in the future. I had the same problem that Debugger.Launch didn't seem to do anything. It turns out that someone else went into my machine, and the debugger application that was released in their environment, not mine. I threw them out of the system and fixed it.

+3
source

All Articles