59

I've met with a strange problem. I had 7 projects in the solution. I had to add another MVC project. Now when the document (from the new project) is opened (for example HomeController.cs) and when this project is initializing at the start, it freezes the whole IDE like this:

enter image description here

(Some projects do not load)

After that, I have to kill the process. When I open VS again and fast click on another project (which is initializing) the freezing issue is gone. I have no idea what can cause a problem like this. I've tried with and without ReSharper but I get the same result. Also, I restored default settings of VS. Also repaired whole VS.

Maybe someone had the same problem and could give some helpful advice?

krypru
  • 1,492
  • 3
  • 19
  • 28
  • Possible duplicate of [Why Visual Studio 2015 freezes crashes hangs on Designer view?](http://stackoverflow.com/questions/37681942/why-visual-studio-2015-freezes-crashes-hangs-on-designer-view) – Khalil Khalaf Sep 26 '16 at 12:59

9 Answers9

160

Usually removing of the hidden .vs folder in solution directory fixes the problem.

Artiom
  • 7,312
  • 3
  • 36
  • 44
  • @ElteHupkes, unfortunately, this problem is not reproduced for me for a long time already. Try to delete temp files, disable plugins or load VS in safe mode `devenv.exe /SafeMode` – Artiom Oct 19 '17 at 12:58
  • 7
    This applies to VS 2019 too! However, do you know what is it with the .vs folder that could case VS to hang. – shekhar Sep 04 '19 at 08:41
  • Good answer. Thank you!! –  Mar 25 '21 at 08:20
  • This is valid for VS 2022 also! Deleting the `.VS` folder worked for me. Without it, many sub processes would do don't-know-what, and hangs VS. – Ajay Feb 21 '22 at 10:02
34

Possible solutions:

  • Delete .vs folder as mentioned above

  • Clear temp files from %USERPROFILE%\AppData\Local\Temp

  • Readjust source control in Tools -> Options -> Source control -> Plugins, set to None, Save, close VS. Then reopen it and reset the plugin.

There is no particular order, but one of them might help.

Alexander Abakumov
  • 12,301
  • 14
  • 79
  • 125
ash
  • 341
  • 3
  • 3
3

I used to have this problem, it was solved just by double clicking any of the stuck projects. This nudges the loading process somehow and causes unloaded projects to complete its loading.

Sisyphus
  • 864
  • 12
  • 30
  • I have been doing that way before knowing the real answer. But at the end your suggestion doesn't solve the problem. – krypru Jan 16 '18 at 19:13
  • Right. I basically ignored the popup. I could still click on the project elements, so when I built/ran the project it went away. – Dave Jun 19 '19 at 16:25
3

I experienced the same issue with VS 2019 and fixed it by deleting the user.json file from %USERPROFILE%\AppData\Roaming\Visual Studio Setup

EDIT

The issue reappeared after a few days, so I located the user settings for Visual Studio 2019 (%USERPROFILE%\AppData\Roaming\Microsoft\VisualStudio\16.0_f124b472) and deleting the following files seemed to have reset VS to a normal state:

Current.vsk
User.vsk
ObjBrowEx.dat

Please close all your solutions before deleting the files

MJ33
  • 809
  • 11
  • 25
  • 1
    Glad I came back here to see your edit because it reappeared for me too! It works now after I deleted only the `User.vsk` – Pieter Buys Jan 13 '21 at 13:50
2

Delete the .suo file in the solution folder.

I am pretty sure I found this answer somewhere on Stackoverflow before, but now I can't find it anymore. Credits to whoever came up with this.

vmb100
  • 127
  • 1
  • 7
1

None of above answers worked for me and found this solution. By opening solution in safe mode devenv.exe /SafeMode will show you details about file causing issue and then

  • Search for all the files in the project directory with extension *.user
  • and remove them all
  • last reloaded the projects
Aneeq Azam Khan
  • 846
  • 1
  • 10
  • 22
  • For me a old Database project caused the VS to crash... executing VS in safe mode helped me to find the issue. – David P May 12 '21 at 08:45
0

For Visual Studio 2019, I cleared my %USERPROFILE%\AppData\Local\Temp folder. It worked.

0

When you get over the past install multiply versions and the previous version was not fully uninstalled. This cause this issue in my case.

Control Panel > Programs > Programs and Features
Search for all Visual Studio related programs and Uninstall those.

niek tuytel
  • 685
  • 6
  • 17
-8

Open the project as a website instead of loading solution file

shahida
  • 301
  • 3
  • 9
  • 1
    You can seriously corrupt a project if you try and open it as a website. What if it was a desktop app? How would your solution work? – Kevin B Burns Dec 01 '20 at 16:58