Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slow debugging issue in Visual Studio

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.

like image 628
George2 Avatar asked Feb 26 '09 06:02

George2


People also ask

Why does Visual Studio run so slow?

You might have extensions installed that slow Visual Studio down. For help on managing extensions to improve performance, see Change extension settings to improve performance. Similarly, you might have tool windows that slow Visual Studio down.

Is debug mode slower?

One of the main reasons that the debug version is significantly slower is because of these extra diagnostics. as to why you want to run in Debug, it's because those extra diagnostics are doing lots of useful stuff that help you catch bugs in your program so that you have more chance of the release build working.

How do I fix the Debug executable in Visual Studio?

Just use File/Open Project/Solution, select EXE file and Open it. Then select Debug/Start debugging. The other option is to run the EXE first and then Select Debug/Attach to process.

What is IntelliTrace in Visual Studio?

IntelliTrace always records events that happen in the Visual Studio debugger. For example, starting your application is a debugger event. Other debugger events are stopping events, which cause your application to break execution.


2 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.

like image 86
zweiterlinde Avatar answered Sep 24 '22 14:09

zweiterlinde


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.

like image 39
m-sharp Avatar answered Sep 21 '22 14:09

m-sharp