Debugger.Launch not working

11,382

Solution 1

I have the same problem in Visual Studio 2013 Premium. Eric's answer put me over how to resolve it. But you don't need to change the register.

  1. Go to Tools --> Options --> Debugging
  2. Open the item and select just in time debugger
  3. If you see in the low part of the window a yellow warning about that other debug is being used different to Visual Studio. If you see that, check all Just in Time checkboxes to return to VS to be the debug program.

That is all!

Options Just in Time debugger

Solution 2

That is a lame answer, since I can't find any reference to VS Express in the question and I had the same problem while using VS2013 Pro.

Even though this article sais the issue is solved in VS2013, even if you are using VS2013 like me, look for the temporary fixes tab listed there. I fixed the issue using it. More info in the link.

I'll just link another article which put me in the right direction, perhaps it's useful too.

Summary: Change the AppIDFlags value of the Visual Studio Just-In-Time Debugger registry key from 0x28 to 0x8 (or 0x20 according to the article above, trial and error I guess) They registry key is HKEY_CLASSES_ROOT\AppID\{E62A7A31-6025-408E-87F6-81AEB0DC9347}

Solution 3

Perhaps this will helps someone in the future. I had the same issue, that Debugger.Launch didn't appear to do anything. Turns out that someone else was logged into my machine and the debugger attach promped launched in their environment, not mine. I kicked them out of the system and that fixed it.

Share:
11,382

Related videos on Youtube

Trevor Sundberg
Author by

Trevor Sundberg

Updated on September 15, 2022

Comments

  • Trevor Sundberg
    Trevor Sundberg over 1 year

    I am currently trying to launch a debugger for a process that is launched externally (not from within visual studio). I cannot seem to get a debugger actually launch, as it appears nothing happens. In the 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 asserts are there to verify that I'm not crazy. At first, the IsAttached property returns false as I expect. I then call Debugger.Launch, and that returns true. As per the MSDN documentation of Debugger.Launch, it says it will only return true if it succeeds in launching the debugger, or if one is already attached. I verified one was not attached, so it must have launched one.

    The break-point never gets hit, and the second verify fails (the IsAttached property returns false). I also attempted to put a sleep in after Debugger.Launch to give it some time, to no avail.

    Any suggestions?

  • Daniel Balas
    Daniel Balas over 9 years
    This worked for me. I'm using Just In Time Debugger almost daily, but one day it stopped working and mentioned checkboxes were unchecked - i.e. something disabled it. I don't have any idea what though.
  • Tigerware
    Tigerware about 5 years
    This worked for me with VS 2017 Professional! I changed it from 0x28 to 0x8.
  • AmirHossein Rezaei
    AmirHossein Rezaei about 4 years
    Also check that "just in time debugger" is installed by visual studio.
  • TC55
    TC55 about 2 years
    It also worked for VS 2012 Professional. I changed it from 0x28 to 0x8. Thanks!