Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Freezing On Opening Project

My Visual Studio seems to be freezing/lagging when I open a existing project. I have added NHibernate framework into my code and it seems to lag my computer (at least that's what I think). When I open other projects, I do not lag or freeze at all. The freeze is about 3- seconds to a minute, then it will open my project and it will just act very slowly, it might take 20+ seconds just to switch classes an 20+ more seconds just to type a single character into visual studios.

I was wondering if anyone has had this problem before. If so how did you fix it?

I can't really work on my code until this is fixed. Oh also, when is save the code, it freezes for a good minute or two also.

like image 750
kevin Avatar asked Nov 10 '09 19:11

kevin


People also ask

Why does Visual Studio freeze so much?

The freeze of the solution is caused by a feature that is meant to fasten up solution loading: parallel project initialization. It seems to be an issue that some others already had with 16.2. x versions, so it may be a regression (as it is flagged as fixed).

How do I unfreeze Visual Studio?

I purposefully froze my terminal with CTRL S in visual studio code, so that I could inspect the fast log messages scrolling through. Normally, you can unfreeze it again with CTRL Q .

How do I fix Visual Studio from crashing?

Use Visual Studio normally to reproduce the crash, once crash occurs let all Windows crash dialogs finish processing. Go to %LOCALAPPDATA%\CrashDumps and locate the latest dump file for devenv.exe process. You can then attach this file to the feedback issue.

Why VS code is hanging?

If while opening a large file, VSCode freezes and then crashes, you need to delete some files. So, open Run, paste “%AppData%” and click Ok. Now, open Code > Backup and then delete the only folder that is inside that directory. Finally, restart VSCode and see if the issue persists.


2 Answers

You can see exactly what VS is doing at any given moment, if you attach a debugger to the devenv.exe process and hit Break when it hangs. Then load the symbols from Microsoft Symbols server and show the call stack for the VS main thread.

I wrote a very detailed article about how to debug crashes and hangs here: http://blogs.msdn.com/kirillosenkov/archive/2008/12/07/how-to-debug-crashes-and-hangs.aspx

From the call stack it should be obvious what is causing the delay.

like image 102
Kirill Osenkov Avatar answered Oct 19 '22 10:10

Kirill Osenkov


For me, removing the suo file (from the v14 sub directory) solved the problem...

like image 34
user3193904 Avatar answered Oct 19 '22 11:10

user3193904