Home > Back-end >  Visual Studio 2022 - .NET 4.5 MVC Web app - very slow to load when compilation debug=true
Visual Studio 2022 - .NET 4.5 MVC Web app - very slow to load when compilation debug=true

Time:02-03

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.

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?

CodePudding user response:

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.

  • Related