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?
Kernel-mode code can determine the status of kernel debugging by using the following variables and routines: The KD_DEBUGGER_ENABLED global kernel variable indicates whether kernel debugging is enabled. The KD_DEBUGGER_NOT_PRESENT global kernel variable indicates whether a kernel debugger is currently attached.
In the Visual Studio toolbar, make sure the configuration is set to Debug. To start debugging, select the profile name in the toolbar, such as <project profile name>, IIS Express, or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5.
Assert(Boolean, Debug+AssertInterpolatedStringHandler) Checks for a condition; if the condition is false , outputs a specified message and displays a message box that shows the call stack. public: static void Assert(bool condition, System::Diagnostics::Debug::AssertInterpolatedStringHandler % message); C# Copy.
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.
That is all!
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}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With