Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2008 Debugger Hang

I'm using Visual Studio 2008 Team System with SP1, and I've noticed an annoying tendency for the IDE to hang for several (10-15) seconds whenever I stop debugging an application. At first I thought this only happened with WPF apps, but I've observed the behavior in Windows Forms apps and ASP.NET sites as well. I've made a series of changes to the Options based on this previous post and done exhaustive Google/MSDN searches, but still haven't found a way to stop this.

Anyone have any ideas?


@korona - Nope, that didn't fix it. Thanks for your suggestion, though.

More research in ProcMon shows this interesting tidbit, not sure if it is related:

8:45:46.6790857 AM  WindowsFormsApplication1.vshost.exe 7684    FASTIO_CHECK_IF_POSSIBLE    C:\WINXP\Microsoft.NET\Framework\v2.0.50727\CONFIG\enterprisesec.config.cch FAST IO DISALLOWED  Operation: Read, Offset: 48, Length: 12
8:45:46.6793569 AM  WindowsFormsApplication1.vshost.exe 7684    ReadFile    C:\WINXP\Microsoft.NET\Framework\v2.0.50727\CONFIG\enterprisesec.config.cch FAST IO DISALLOWED  Offset: 508, Length: 12

This repeats several times, like hundreds of times, then it switches to a different path:

8:45:46.7470314 AM  WindowsFormsApplication1.vshost.exe 7684    FASTIO_CHECK_IF_POSSIBLE    D:\documents and settings\myusername\Application Data\Microsoft\CLR Security Config\v2.0.50727.42\security.config.cch   FAST IO DISALLOWED  Operation: Read, Offset: 48, Length: 12
8:45:46.7472187 AM  WindowsFormsApplication1.vshost.exe 7684    ReadFile    D:\documents and settings\myusername\Application Data\Microsoft\CLR Security Config\v2.0.50727.42\security.config.cch   FAST IO DISALLOWED  Offset: 508, Length: 12

And repeats again many more times, with slight changes in the offset each iteration. Maybe unrelated, but....

like image 887
AJ. Avatar asked Oct 13 '08 20:10

AJ.


People also ask

How do you debug a hang?

Use the debugger to find out what your app is doing when it appears to hang. Run your program under the debugger. Let it run until it hangs. When it hangs, switch to the debugger and select "Debug: Break All" (or equivalent) to make the debugger freeze all threads and take control of the process.

Why is my VS code debugger not working?

Debugger not working Look at the debugger console for any error messages displayed. Look at the Debugger Tools console output for any errors. Remember to re-start VS Code once done (this won't be necessary in a future release). Solution: Clear all expressions from the debugger Watch window and start debugging again.

How do I stop a debug session?

To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.


2 Answers

Looking at your ProcMon results, it appears that it's that CreateFile() call that's taking all the time. I'm assuming that all activity is waiting for that thread to return. You can verify this -- with some difficulty -- in Process Explorer (also part of the SysInternals package previously linked), using the Threads tab on the Properties window.

So, if CreateFile is what's causing the blockage, that would suggest that it's a delay in Windows itself. What Pierre said -- look out for network shares -- was my first instinct, too. I've had a lot of seemingly-inexplicable slowdowns in the past when Explorer had a mapping to a share that I couldn't currently reach, even though I wasn't doing any work on those shares at the time.

Can you test this possibility by unmapping all your drives and unplugging from the network? Is D: a separate physical drive from C:? If so, see if it goes faster if you move your build directory to C:.

like image 122
Kevin Crumley Avatar answered Sep 23 '22 17:09

Kevin Crumley


I observed this kind of behaviour on one of my development machines and Visual Studio 2005. The problem was caused by Visual Studio trying to reach some non existent network share (I don't remember exactly why). You could give Process Monitor a try in order to see if your Visual Studio is trying to do something silly when finishing debugging and returning to the normal view. Maybe because you have some broken plug-in in some tool bar or in your toolbox.

like image 31
Pierre Arnaud Avatar answered Sep 26 '22 17:09

Pierre Arnaud