Visual Studio Freezing On Opening Project

北战南征 提交于 2019-12-03 11:47:02

问题


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.


回答1:


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.




回答2:


Had the same problem. Closed Visual Studio 2010, opened again Running as Administrator, went to Extension Manager, uninstalled Nuget Package Manager, restarted Visual Studio 2010 running as regular user, opened problem solution, solution opened fine.

Nuget Package Manager seems to be the cause. My problem solution is using EF 4.3 Code First which interacts heavily with the Package Manager Console, but that may just be a coincidence.




回答3:


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




回答4:


I had a hunch that something had been corrupted with one of my NuGet packages, and completely deleted the \packages subfolder and its contents. When I reopened the solution, all projects loaded successfully without hanging.

From there, I restored the previously deleted packages from the NuGet Package Manager Console and I was back up and running.




回答5:


As answer by Visual Studio 2015 Freezing White Loading Solution delete the .vs hidden directory solved the issue for me.

I am using Visual Studio 2017 Community Edition.




回答6:


What, if any Add-ins do you have installed?

Edit:

One suggestion I would have then is to systematically disable each of your add-ins and see if performance changes and if it does research the culprit and see if there any updates available.




回答7:


Uninstall any MS Enterprise Framework addin's you may have.

Delete the VS temp directory (and the Windows one).

Do you use TFS? Perhaps the server is a bit sleepy, that will make it freeze for a few minutes, but is ok afterwards.




回答8:


For me, a chkdsk /F /R (which will prompt you to restart) and about 30 minutes of company time fixed this issue.

I think a few improperly closed instances of Visual Studio may have attributed to the issue.




回答9:


My local files somehow became corrupted for one project, fortunately I didn't have any pending changes so rather than run chkdsk I just deleted the folder and checked out the solution from source control again.



来源:https://stackoverflow.com/questions/1710408/visual-studio-freezing-on-opening-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!