0

On Visual Studio 2022, when debugging .NET 4.5 MVC Web app, it takes MINUTES to load the website.

When launching the website for debug, I can see in the output console, the loading and unloading of lots of dlls, from GAC, temp folder, etc, and it takes some seconds for each dll, it's very slow, at the end it can take 10 minutes until the website finally loads! And if I navigate to other page in this website, it takes again some minutes to load each page! Its so frustrating.

CPU usage is very high while debugging, with visual studio taking more than 70% of the resources, even after stop debugging.

I tested to create a new project with the same .NET version template and the debug was fast, less than 20 seconds to load. Also tested with a new .NET core project and it worked well too the debug.

So maybe is something on this project, like some dll dependencies that is causing this? The project is not so big to cause this slowness. I can't find a change that could cause this, it worked well on the past on this machine, and I don't have other machine to test right now.

If I change web.config: <system.web>... instead of true, it loads quickly and works well, but can't debug. Tried multiple possible solutions from forums without success: clean .NET temp and project related folders, pre load debug symbols, used "Enable Just My Code" debug option, removed all breakpoints, tried in IIS Express and local IIS, and lots of other configs, also restored windows and reinstalled Visual studio.

Util Sites
  • 11
  • 3
  • That's exactly the cost to pay for debugging, especially when you enable certain debug options. So, unless you grant someone access to your machine to review the settings, this question won't be answered easily. – Lex Li Jan 30 '23 at 16:40
  • One of the settings that might help ... is the option "Just My Code" ... if this has already been enabled, you may want to state that in your question. – Scott Hoffman Jan 30 '23 at 20:37
  • @LexLi I would like to do that? Who is available? There is some service for that? Even if needs some payment. – Util Sites Jan 30 '23 at 21:28
  • @ScottHoffman added that information, already tried. – Util Sites Jan 30 '23 at 21:29
  • I noticed an alert in Debugging/"Just-In-Time" option: "another debugger has registered itself as the just-in-time" - check image [link](https://pasteboard.co/j7tLP9LAuueZ.jpg). Maybe this is some suspicious clue that can help solving the problem? – Util Sites Jan 30 '23 at 21:34
  • I'm not sure what caused the problem, but it seems it was after installing this software: [onvifdm](https://sourceforge.net/projects/onvifdm/), that uses .net 4 too and F#, maybe this polluted GAC or machine config? Bad decision, later uninstalled :( It was strange after restore point Windows and reinstalling everything VS related, and installing again, to run my C# project, I had to install F#, requested by visual studio. Strange... – Util Sites Jan 30 '23 at 22:07
  • The software you pointed out does not see to be the likely culprit, as its description does not have any link to VS or .NET debugging. If you like, open a support case via https://support.microsoft.com so that a support professional can help review your setup and investigate further. – Lex Li Jan 31 '23 at 00:50
  • Try removing some development tools (such as python and data science ) from the vs installer, maybe it will help some performance. Also does your project set a lot of breakpoints? The debugger may take some time to start and stop debugging operation breakpoints. But the information provided in the forum alone is not enough to investigate this issue and find a solution, you'd better open a support ticket with Microsoft via https://support.microsoft.com and ask a professional engineer to help you capture and analyze performance trace files. – YurongDai Jan 31 '23 at 05:30
  • Is the debugger loading all your symbols? Take a look at the "Modules" pane and see whether symbols are loaded for all those DLLs. If so, you should investigate your debugger settings and fix that. In fact, you may wish to back up all your IDE settings and reset to factory defaults, just to see whether that helps. Launching into the debugger should be fast. Failing all that, open a ticket via _Help | Feedback | Report a problem_ and include a recording so someone can investigate why it's running slowly. – Drew Noakes Jan 31 '23 at 11:57
  • @LexLi The software that I mentioned uses .net 4 and F# and brings lots of libs, I was checking their code, and it makes changes on windows on install, maybe GAC? But maybe that not the problem, I don't know, but the timeline of the problem was very close. I'm opening visual support feedback ticket. – Util Sites Jan 31 '23 at 15:49
  • @YurongDai I have few tools, mainly only web development related in VS. I removed all the breakpoints. I'm opening visual support feedback ticket. – Util Sites Jan 31 '23 at 15:50
  • @DrewNoakes I look at the Modules, and the symbols of the main dll of the project was not loaded! But maybe it was because I changed the symbols loading configuration, to don't download more symbols, after loaded all of them like suggested in some forums. I loaded the symbols for that dlls manually but the problem remains. How can I reset all the IDE settings? I'm doing that now -> Help | Feedback | Report a problem. Noticed that the CPU has very high usage while debuging, with Visual Studio taking more than 70% of CPU resources. – Util Sites Jan 31 '23 at 15:54
  • Posted ticket to VS team feedback with logs, so they can identify the problem maybe: https://developercommunity.visualstudio.com/t/Visual-Studio-2022---NET-45-MVC-Web-ap/10265850 – Util Sites Jan 31 '23 at 16:08
  • @UtilSites I'd be more concerned about all the _other_ modules having symbols loaded. Loading symbols takes time. A program can load a lot of modules, and loading all their symbols can lead to the slowdown you're seeing. To reset your settings, use _Tools | Import and export settings_. You can first export to make a backup, then do a reset. – Drew Noakes Jan 31 '23 at 22:59
  • 1
    @DrewNoakes THANKS! Now it loads the website in less than 10 seconds in debug. Resetting all the Visual Studio settings solved the problem!! I didn't know that option. So I'm not sure what config was causing this, now noticed that the debug output window don't show any logs but everything works quick. Going to add this as solution and credit to you. – Util Sites Feb 01 '23 at 11:58

1 Answers1

0

Resetting all the Visual Studio 2022 settings solved the problem! Using Menu Tools | Import and export settings.

Now the website loads in less than 10 seconds in debug and every page is very quick to load then.

So I'm not sure what config was causing the problem, maybe was related to dll symbol loading configs (besides tested recommended changes there).

Now noticed that the debug output window don't show any logs but everything works quick.

Thanks to @DrewNoakes that sugested this solution in the comments.

Util Sites
  • 11
  • 3