Slow debugging issue in Visual Studio

Viewed 99168

In my Visual Studio instance, even if I just wrote a single line of return in a C# console application, it will take me a minute after pressing F5 to execute the actual code (I mean the time it takes to stop on the single return statement after pressing F5 -- I set a breakpoint on the return statement in the main function). What is wrong? Is there a check list?

I am using Visual Studio 2008 VSTS edition and debugging on Windows Server 2003 x64.

24 Answers

You may need to delete all your breakpoints---note that you need to click the "Delete all breakpoints" button (or use Ctrl + Shift + F9), NOT just delete them one by one. If Visual Studio has mangled your solution settings the latter will not work. You may need to add a breakpoint first, in order for this to work (clever, eh?).

If worst comes to worst, you may need to delete your .suo file and let Visual Studio start a new one from scratch. Note that you will lose your personal solution configuration settings, however (only for this solution, not any others). However, you may want to move/rename the file temporarily until you determine whether or not this is the problem; that way, you can always move it back. I have seen some online resources recommend deleting (moving/renaming) the .ncb file as well.

I have seen this before. Try deleting all your breakpoints and then set the ones you want. Hit F5. Is it faster now?

I just noticed that you mentioned setting up the .NET source debugging feature. Try to disable that. Your network connectivity to Microsoft's source server may be slow. Also disable any symbol server connectivity in menu ToolsOptionsDebuggingSymbols.

Also try disabling "Enable property evaluation and other implicit function calls" in menu ToolsOptionsDebuggingGeneral.

Do you have a lot of breakpoints set? Those can really slow down startup time. Everytime a new module is loaded into the process address space, they all need to be checked to see if they are valid.

Go to menu ToolsOptionsDebuggerSymbols and check if you have public symbols set or UNC network paths set. Also check menu Tools* → OptionsDebuggerGeneral to see if you have source server set.

All of these can affect debugging based on slow network speed or unavailable servers. The 5 minute wait time is network timeouts.

If nothing in options is set, check to see if you have the _NT_SYMBOL_PATH environment variable set.

From ScottGu's blog linked by Travis: "One other performance gotcha I've heard about recently is an issue that a few people have reported running into with the Google Toolbar add-in. For some reason this can sometimes cause long delays when attaching the Visual Studio debugger to the browser. If you are seeing long delays with your web application loading, and have the Google Toolbar (or other toolbars) installed, you might want to try uninstalling them to see if that is the cause of the issue."

Make sure you don't have any stale network mappings to servers that no longer exist (network timeouts will kill you). Or use something like Process Monitor to see if a network (or other file error) seems to be blocking for a long time.

Are you using a symbolsServer to download symbols for Windows DLL files?

If so, disable that as it can take some time, but I wouldn't expect that to cause long delays in a basic console application.

Menu ToolsOptionsDebuggingSymbols.

In my case Google Toolbar was slowing down my debugging.

gplus_notifications_gadget.html just kept going on and on overloading the debugger. I wanted to keep the Google Toolbar because I use it on a regular basis, so I just disabled the G+ notification button (the small button besides the profile button). It is happy now.

Related