Debugging in visual studio 2008 freezes entire system - visual-studio

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.

Related

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

Visual Studio 2010 hangs on attach to process / debugging

Whenever I try to debug a Visual Studio 2010 web project, VS hangs, and ultimately crashes. This happens if I try to start the project using F5, or through Attach to Process, before the process list even appears.
Hitting F5 in, for example, a Windows Form project works fine, but attach to process fails here too.
Any ideas on what can be causing this? Obviously attaching to the devenv.exe process won't work as I can't get the Attach to Process dialog to appear...
Oh, running W7 (x64), VS2010 SP1 (had same problems without SP1)
In Solution Explorer there is a Show All Files icon (highlighted in the photo below):
Make sure it's turned off,
When It's turned on, Visual Studio tries to index all the files in the solution and if you have a giant Solution it could take forever!
I hope this has helped someone :)
Have you recently installed Mono and/or Mono Tools for VS2010?
I found that to be the problem it my case. Not sure why, but it somehow got in the way.
Matthew
In my case hangs when executable type was not correctly set, ex. Managed v4.0 and trying to attach to Native.

Browser keep stopping with user breakpoint and opens visual studio 6 in debug mode

Following my last question (see: Problem in hosting ActiveX on Vista (in a Visual Studio 6 C++ application)) I ran into a strange problem. I hope this’ll be a simpler issue to the experts here:
Each time I run certain application like iexplorer or firefox, the Visual Studio 6 suddenly opens up in debug mode with a message “User breakpoint called from code at 0xSOMETHING”.
I can press F5 to continue but the applications run slowly and needless to say I have no wish to debug these applications…
My guess is that when I worked on my VC++ application I placed breakpoints at windows methods like CAxDialogImpl::Create(), AtlAxCreateDialogA() etc’, and for some reason it was kept somewhere.
Of course I now removed all the breakpoints and re-compiled the project but still this keeps happening!
I checked in the tools->options but the “Just-in–time debugging” is not marked.
Any idea?
(I use Visual Studio 6 which I installed on Vista)
Thanks a lot,
Erik
Not sure this helps but anyways:
Try disbaling the default debugger option. (It says Dr. Watson but it depends what you have set as the default debugger)
http://www.bridgetonova.com/2007/09/how-to-disableenable-windows-default.html
Also as per this post Visual Studio 6 is not supported on Vista. Only Visual Basic is.
http://www.itwriting.com/blog/167-visual-studio-6-on-vista.html
You should probably re-ensure yourself that you have removed all calls to DebugBreak() and manual break-points. Also try to ensure that when you recompile you re-register everything to point to the right places (i.e. the activex pointed to by the guid in the registry is actually the latest recompile).

Visual studio 2008 crashes when starting to debug

When I press F5, everything compiles fine, but when the app is to be started, VS crashes, showing the "Just in time debugger" dialog.
More than one (similar) solution has this problem. A new solution containing just a form, works. This problem started out of the blue, I have made no changes to the environment as far as I can understand.
I can start the app without debugging (ctrl+F5), and then attach the debugger.
I'm using VS 2008 sp 1.
Never seen this issue, have you tried turning off all your plug-ins like reSharper, CodeRush, etc.?
Update: When worst comes to worst I usually try this command line.
devenv.exe /ResetSettings
devenv.exe /ResetSkipPkgs
devenv.exe /Setup
try all these you can do them all at once or do them individually it is up to you. But be aware that you will be deleting all your settings that you have customized in to Visual Studio, so you may want to back them up.
The last thing you can try is this, to see if the problem is with something weird that is running.
devenv.exe /SafeMode
Starts Visual Studio in safe mode, and loads only the default environment and services, and shipped versions of third-party packages.
I've found the problem now. I had "Step framework source" enabled, which somehow broke the debugger (strange though, because it usually works). Turning that off, made me debug as usual again.
If you have undocked windows in debug layout search KB960075 on code.msdn.microsoft.com (can't add hrefs).
Do you have CLI.exe error issues? Check your event log. I've had the same issue and simply re-staged my machine out of panic since I was so near a deadline. I assumed that it was an issue with the registry and couldn't find an answer.
try repair or reinstall, don't waste time findin' the reason of the problem
I had the same problem, out of the blue the IDE would crash when I started to debug. Happened with any existing project that I opened, even the visual studio samples. I created a new project, just a blank dialog, ran it, and all was good. After that, the problem went away and I was able to debug again.
This happened to me just now, after my computer rebooted itself last night. When I was pressing F5 the app started but instantly shut down and the VS IDE crashed.
To fix it: Debug->Delete All Breakpoints. It worked for me.

Visual Studio detaches from application as soon as debugging starts

I have a web application that I've always been able to run in Visual Studio and it debugs just fine (breakpoints work, I can pause execution, etc). Recently, the behavior changed suddenly, and a few things happen:
I start debugging, it lauches IE and loads the application, but after a few seconds (sometimes the page hasn't even displayed yet), Visual Studio acts as if debugging has stopped - I'm able to edit code in VS again, and the "Play" button on the toolbar is enabled. The application continues to run in the IE window just spawned, but I'm not attached to it
During this few seconds that VS is "debugging", because it detaches, my breakpoints show as hollow - as if I'm set to "Release" mode and they won't be hit. In fact, I have a breakpoint set in Page_Load, and it skips right by. I've checked, and I'm set to debug mode, though the compile mode dropdown is missing from my toolbar (I checked in the build properties to ensure I was in debug mode).
Can anybody shed some light here?
It turns out that this was actually a result of an upgrade to Windows Vista. VS wasn't being "Run as an Administrator", which caused it to lack the rights to attach to other processes for debugging. As a result, debugging would stop right after it started. Changing the VS shortcut to run as an administrator resolved this problem.
I've experienced samely looking behavior. The cause was in existence of several <system.web> sections (which is allowed by web.config schema). Visual Studio debugger (versions 2008 and 2010 were tested) looks in the first encountered section only. So if your <compilation debug="true"> tag is not in the first one, it thinks that there are no compilation.debug setting present and genrally tryes to add <compilation debug="true"> to the first <system.web>. In some cases VS2008 just silently procceds in this case. For example look here: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=510354#details"
Have you installed anything else on the server / workstation recently?
We have a third party app that doesn't allow us to debug, w3wp.exe crashes immediately upon an attempt to debug.
I ran into something similar when I had placed some code in a constructor that was crashing. Exact same issues where the Debug would disconnect just after the application started up.
The short if it, check that you haven't configured a class constructor to run during web startup that is crashing...
Quick windows 7 update: I had to add "localhost" to my list of trusted sites to correct this issue...go figure.
Just a workaround for those (like me) for whom the above solutions do not work: After starting the app you wish to debug, go to Debug -> Attach to Process, and attach it to the process you want to debug. Works on my machine.
In my case, I faced this issue with Visual Studio 2019 and 2022 as well.
I tried upgrading/downgrading Visual Studio versions but nothing helped.
On debugging, I finally found the root cause and sharing it here to help others facing the same problem.
I was using Brave browser with Visual Studio and whenever I uploaded a file in my application, the Visual Studio debugging stopped automatically. The root cause of this issue is the feature in Visual Studio to stop debugging on closing the browser. With Brave browser Visual Studio feels like we have closed the browser on uploading the file. So to fix this issue I have turned of this setting as given here.
You can find this setting here
Tools > Options > Projects and Solutions > Web Projects > Stop debugger when browser window is closed, close browser when debugging stops
Just turn it off and everything should work fine.

Resources