Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio debugging painfully slow when loading symbols

I have an issue which is practically similar to Visual Studio debugging/loading very slow but I haven't managed to find a solution to such a problem.

I have tried all what is described within that question and still, the symbol loading for the very first time is drastically slow.

Similarly to the other question, when starting an MVC project, I get several lines within the Output panel which consist of something similar to:

'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\02ba097f\ab73cbf7\App_Web__headerusermenu.cshtml.ee708ea.myhgafpb.dll', Symbols loaded. 'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\02ba097f\ab73cbf7\App_Web__layoutcmsbase.cshtml.ce72eb6d.ovoanhe-.dll', Symbols loaded. 'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\02ba097f\ab73cbf7\App_Web__notificationmessage.cshtml.5346933.9aei7ems.dll', Symbols loaded. 

Such entries take around 300 - 500 ms each and these are executed for all the Partial Views we have within the project, which are quite considerable.

I have tried the solution within the other question but still didn't get any fast response times.

These are some tests we have made:

Using IIS Express

  • Loading website initially takes roughly 2 minutes
  • Stopping website and starting again takes around 1 min 45 sec
  • Once the website is running, I press on Load All Symbols (Tools > Otions > Debugging > Symbols > Load all symbols) and then stop project and run again, and it takes much less, round 25 sec. Still, the Load All Symbols button is disabled while the project isn't running, so for the very first time, I would need to wait until the project has loaded in order to press Load All Symbols

Using Visual Studio Development Server

  • Starting initially, takes roughly 50 sec
  • Stopped project and started again, takes roughly 20 sec
  • Clicking on Load All Symbols, stopping project and starting again takes roughly 15 sec

This is getting extremely frustrating as it is taking an extremely long amount of time in order to load project for the first time.

Any possible solution other than those mentioned within the question Visual Studio debugging/loading very slow which might help?

like image 735
Mark Cassar Avatar asked Jul 15 '13 17:07

Mark Cassar


People also ask

Why does my 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 stop the Visual Studio from loading symbols?

You may have a symbol server or symbol path set in your symbol settings (Tools->Options->Debugging->Symbols) that is being queried every time a dll is loaded. You can disable, or delete any such paths.

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

In my case, I had a file open in VS that was not part of my current solution (it happened to be an XML file which I had marked with breakpoints for quick-reference). When I removed those particular breakpoints, the issue resolved.

like image 139
MFry Avatar answered Oct 04 '22 01:10

MFry


Try any of the following ...

  1. Enable Just My Code
    Go to Tools > Options > Debugging > General
    Check "Enable Just my Code"
    Enable Just my Code

  2. Cache Symbols Locally
    Go to Tools > Options > Debugging > Symbols Browse to local directory (make sure it's not on a network share) Click "Load All Symbols" or run the project to hydrate the cache

    Cache Symbols

  3. Remove Remote Symbol Servers

    When you select a remote symbol server, Visual Studio gives you the following warning:

    The performance of remote symbols stores can vary due to latency, bandwidth, or availability of servers. Debugging performance can be improved by selecting the option to load only specified modules when enabling this server

    After loading your symbol cache, deselect remote symbols servers

    Go to Tools > Options > Debugging > Symbols Deselect "Microsoft Symbol Servers" to prevent Visual Studio from remotely querying the Microsoft servers. Deselect Microsoft Symbol Servers

Further Reading

Stack Overflow

  • Visual Studio debugging/loading very slow
  • Visual Studio Build Very Slow
  • Slow startup with IIS Express
  • Website takes a long time to start after solution build

MS Docs

  • Visual Studio debugger documentation
  • Debug only user code with Just My Code
  • Specify symbol (.pdb) and source files in the Visual Studio debugger
  • Debugger Settings and Preparation
like image 41
KyleMit Avatar answered Oct 04 '22 01:10

KyleMit