19

After I install Visual Studio 2013 update 2, I notice that right click on any kind of project file (aspx, cshtml) causes about 45 seconds of hang in Visual Studio. It eventually opens context menu, but every single time this happens.

If I right click on Solution Explorer, Class View etc.. there is no issue at all, just in files editor.

I am using intel i7 processor and 16gb ram (hardware is not an issue) and Windows 8.1 Pro.

I also cannot connect tfs online for last 2 days so I am using my solution with disconnect from tfs. This causes hangs on start up because it tries to connect remote server. But I am not sure it will cause issue on right click of the files.

What I did up to this moment;

1- Installed last update again 2- Restarted Visual Studio several times 3- Restarted PC 4- Cleared TFS cache files

Is there any idea what is causing this issue?

Update: I created an empty MVC project without TFS binding and there is not issue. Looks like it is totally related to TFS dis-connectivity, I will investigate more and will post answer if find out.

Rudey
  • 4,717
  • 4
  • 42
  • 84
Teoman shipahi
  • 47,454
  • 15
  • 134
  • 158

4 Answers4

25

ReSharper can cause this problem. You can suspend it (temporarily) to see if the problem is solved. If it is indeed solved, you should clear ReSharper's cache before you enable it again. Go to %LOCALAPPDATA%\JetBrains\ReSharper and delete the SolutionCaches folder for whatever version of ReSharper you are using.

Community
  • 1
  • 1
Rudey
  • 4,717
  • 4
  • 42
  • 84
  • 1
    I figured out that it is related to TFS dis-connectivity. If I create non TFS connected app, it does not hangs. Weird that how Microsoft missed this bug. – Teoman shipahi Sep 02 '14 at 22:00
  • 1
    Ah, okay! Well, I had the same problem, and found your question. You mentioned ReSharper, which led me to suspending ReSharper, fixing my problem. – Rudey Sep 03 '14 at 11:39
  • 1
    This fixed it for me as well. Same exact problem. In addition, searching for files and types was not working. (I could type in the search box, but no search was initiated.) CTRL-click on types and variables to go to definition was also not working. Suspending ReSharper made the problem go away, so I went ahead and simply deleted the folder for the particular solution under the SolutionCaches folder. Also, for anyone who does not know how to suspend Resharper, look here: http://stackoverflow.com/questions/2189792/how-can-i-disable-resharper-in-visual-studio-and-enable-it-again – Øystein Grande Jaren Oct 17 '14 at 11:06
  • 2
    @Teomanshipahi I could be wrong, but I am guessing that TFS had nothing to do with it for you either, and ReSharper is the culprit for you as well. The new (non TFS connected) solution you created will have gotten its own new and clean folder under the ReSharper SolutionCaches folder, so that would explain why the problem only occurs in the original solution. Unless of course a new TFS connected solution also exhibits the same faulty behaviour? – Øystein Grande Jaren Oct 17 '14 at 11:15
  • 1
    This worked for me too!!! I tried to uninstall/reinstall resharper: was not working, tried to delete my solution and get it again: was not working. I deleted all my Resharper folder in AppData and now it works :) – J4N Nov 24 '14 at 14:55
  • I think it will work on any Visual Studio version that has Resharper installed. For me it helped on VS2017 and latest Resharper version. – Pavel Kharibin Apr 25 '18 at 18:53
10

I just had the same issue and in my case wasn't Resharper the culprit. What worked for me was, inside VS, right clicking the SOLUTION, open Nuget Package Manager and at the top was a message telling "There are missing packages". I clicked to restore them and immediately after that the problem was solved.

Augusto Barreto
  • 3,637
  • 4
  • 29
  • 39
2

Just sharing as I had a different cause, so this may help some one else. My visual studio (2015) was locking up for 10-20 seconds on the right click context menu on the solution.

It turned out to be a faulty extension. Go to 'tools' > 'Extensions and updates', and try disabling all your extensions. If that solves it, try enabling a few at a time, until you narrow it down to a particular extension.

In my case, it happened to be the 'ImageOptimizer' extension, that comes part of Madz 'web extention pack': Github issue on 'ImageOptimizer'

MIP1983
  • 1,354
  • 1
  • 15
  • 25
0

Recently had this issue in Visual Studio 2015

For me it was because I had silently been disconnected from the TFS server

When you right click in a source-controlled file, part of the context menu consists of TFS commands (check out for edit, history, annotate). I presume that VS was spinning waiting for a TFS connection that would never come.

Getting reconnected to TFS solved the issue.

AndyG
  • 39,700
  • 8
  • 109
  • 143