kevin
kevin

Reputation: 161

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.

Upvotes: 16

Views: 24111

Answers (10)

Vijay Nerkar
Vijay Nerkar

Reputation: 11

I had same problem. Delete following folder. C:\Users\UserName\AppData\Local\Microsoft\VisualStudio

Upvotes: 0

Ido Ran
Ido Ran

Reputation: 11374

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.

Upvotes: 6

user3193904
user3193904

Reputation: 131

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

Upvotes: 8

Gary DeReese
Gary DeReese

Reputation: 173

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.

Upvotes: 5

Brent
Brent

Reputation: 1388

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.

Upvotes: -2

danyim
danyim

Reputation: 1293

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.

Upvotes: 0

Chris Moschini
Chris Moschini

Reputation: 37947

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.

Upvotes: 7

Kirill Osenkov
Kirill Osenkov

Reputation: 8976

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.

Upvotes: 11

bytebender
bytebender

Reputation: 7491

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.

Upvotes: 1

leppie
leppie

Reputation: 117220

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.

Upvotes: 0

Related Questions