How to close a crashed Visual Studio debugger? - debugging

I feel pretty ridiculous having to ask this, but is there an easy way to close Visual Studio while it's debugging?
I'm debugging my application, and when switching to full screen it crashes. I am unable to alt-tab to visual studio to stop the debugger, and I'm unable to pull any other windows on top of the full screen application.
I can, however, see the start bar. I can right click on visual studio and click close, but it does nothing (same goes for the debugging application).
I'm unable to get the task manager to show in front of the full screen application.. However, I'm on Windows 8 and I've noticed the Metro interface still works (and all metro apps). If I could find a little command prompt metro app I'm sure I could get around this, but I'm unable to.
Is there an easier way to resolve the issue without having to restart my pc each time I crash?
Almost forgot to mention, I'm on Visual Studio 2013
Edit: Forgot to mention, I'm programming on-the-go on a laptop; I only have the one monitor for this situation

I found a solution:
I can toggle focus to Visual Studio via Windows' Alt-Tab hotkey. This won't bring up Visual Studio, though.
Usually the problem is an unhandled exception, which requires me to hit "break." Since I gave Visual Studio focus, I can hit enter to select break.
I then use the Shift+F5 hotkey to stop the debugger

You might be able to use Developer Command Prompt - see MDbg.exe (.NET Framework Command-Line Debugger) to debug and kill your process

Related

Visual Studio JIT Debugger hangs

I've always used System.Diagnostics.Debugger.Launch() as a quick way to debug web services. I get a dialog asking me to choose a debugger, I pick "New instance of Visual Studio" and it fires up VS and lets me step through the code.
That has suddenly stopped working. Now I get the dialog, and choose Visual Studio, and the VS splash screen appears, and then it just hangs. The dialog window says "Not Responding" and I have to force it to close. Even then, a VS instance is left hanging around in Task Manager and I have to kill it manually.
I've tried repairing Visual Studio, and uninstalling and reinstalling Visual Studio, and nothing fixes it.
In desperation, I completely flattened my PC and reinstalled everything from scratch. It lasted about a day and then JIT debugging started hanging again. I was on Windows 10 and Visual Studio 17.4.1 before, and I'm on Windows 11 and Visual Studio 17.4.2 now.
To make sure that it's not a problem with some particular code, I created a one-line console app System.Diagnostics.Debugger.Launch(); and that crashes just the same.
Has anybody experienced anything similar, or have any idea what could be going wrong?
I don't know why that fails, but I suggest to attach to a running instance of Visual Studio instead. Start Visual Studio first, and then when the "launch debugger" window appears, select the running VS instance. Preferably, you should even open the correct solution/project first. If you attach to that instance, all your source code and the project structure is available for debugging.
Another alternative: Instead of using Debugger.Launch(), use a code snipped such as
while (!Debugger.IsAttached)
{
Thread.Sleep(100);
}
at the beginning of your program and attach the debugger from within Visual Studio (using the menu option Debug->Attach to process)
I had the same exact problem and after updated to VS version 17.4.4 the issue disappeared. All good now.

Prevent to start "Debugger-Windows" from first application start in Visual Studio

When I start a program from Visual Studio it also starts several (about 6) additional windows I guess they show some resource information.
My problem is that those windows seems to freeze the whole progam. I cannot close them and have to restart Visual Studio. Is there a way to prevent them to open when I start a application from Visual Studio?
EDIT(Screenshot added):
EDIT: After a downvote without a comment, it looks like i have to add my affords:
Googled over an hour, but because those boxes crashes I dont see what they are supose to be. So I dont know for sure what to look for.
Enabled and dissabled all Debbuging option without any effect.
EDIT: Its a default C# WPF app.
EDIT: Title
Thank you.
Its a TeamViewer issue.
Debug doesnt work in with TeamViewer running.
You have to close TeamViewer.
Start debugger
Close all debugging windows (Watch, Memory)
End debugger
You can now open Teamvierwer again
Source:
https://connect.microsoft.com/VisualStudio/feedback/details/817590/microsoft-visual-studio-express-2013-for-windows-desktop-hangs-on-debug

VS attaching to process disabled

A few days ago, the attach button in "Attach to process" dialogue became disabled in VS 2010 and VS 2008 likewise. At first I thought that it is just an extension I've installed in VS 2010 but then I noticed it is the same in VS 2008. The both VS's a re running in administrative mode and on Windows 7.
I looked around but I can't seem to find a solution to this.
If anybody has encountered an similar problem, a little help would do great.
Thanks upfront.
EDIT: Attached a picture of the dialogue!
Where it says
you should press 'Select' and ensure at least managed is ticked. (or choose automatic)
otherwise, the 'Attach' button will be disabled.
It could also be because there is already another debugger attached to the process - probably the currently running instance of Visual Studio but it may be another instance of Visual Studio, or another debugger entirely (such as WinDbg or a remote debugging session).
Check the "Processes" window (usually found under Debug -> Windows -> Processes) to see what processes Visual Studio is debugging.
Try stopping Visual Studio but don't close the process.
I have come across a weird situation under which Attach button was disabled. This was because of DebugDiag. Please refer the following thread for info.
I was trying to debug a windows service as described here and had the same issue. The solution was to run Visual Studio as Administrator and select to see processes from all users.

How to Disable Visual Studio 2010 windows changing when debugging

When I'm working in VS.Net 2010, then start debugging, seems like a new window profile or something like that kicks in and rearranges/hides windows that I had open previously. Is there any way to disable this "feature"?
No this cannot be disabled.
What you can do to work around it a bit though is the following
Start a debugging session
Arrange the windows to your liking
Stop the debugging session
Close Visual Studio
After this point whenever you start a debugging session it will return to the window arrangument you had at step #2.

Debugging in visual studio 2008 freezes entire system

Any time i try to debug in visual studio 2008 my entire system will freeze whenever a breakpoint is hit.
I can move the mouse around and that remains responsive but nothing i click on does anything,
I can bring up the task manager but can't do anything with it and i am able to lock/unlock the machine.
I tried a fix that i found via google that suggested i disable advanced text services but it didn't work. I am using visual studio 2008 with SP1 running on Windows XP Pro, asking here is my last hope before formating/reinstalling so i hope someone can help me out.
I debug by running the application in debug mode, the freeze happens no matter what the project size and it seems as if it is just the entire GUI that freezes, the computer carries on working just fine i just can't do anything with it because the GUI is totaly unresponsive.
I found I only had this issue when I was using the keyboard to debug. If I used the toolbar debug buttons, I didn't have an issue.
To "fix" this, I set the LowLevelHooksTimeout to 300ms (from 5000ms). You may need to add the DWORD if it isn't already there.
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\Control Panel\Desktop\LowLevelHooksTimeout
HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout
Restart after making this change for good measure.
How big is the project you are running? When I did a Find last night on a huge open source project, I got kind of the same behavior.
Also, did you try Uninstalling just VS2008, then Reinstalling with only the options you use.
Have you tried disabling "Call ToString()" debugger option? This is ON by default, and is known to deadlock.

Resources