Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeLens not showing references

CodeLens stopped working for some reason in project solution that I'm dealing nowadays. It is not showing references instead "- references". However, when I open up Visual Studio with another project It works like charm.I can confirm that CodeLens is enabled. Do you have any idea to make it work?

like image 388
kkocabiyik Avatar asked Dec 29 '13 09:12

kkocabiyik


People also ask

How do I show references in Visual Studio?

Press Shift + F12 to find all references.

Can references be seen in Solution Explorer?

“On the Solution Explorer panel, expand the References list by clicking the arrow to its left. We can now inspect it by double-clicking the MonoGame.

How do I enable find all references in Visual Studio code?

The Find All References command is available on the context (right-click) menu of the element you want to find references to. Or, if you are a keyboard user, press Shift + F12.

How do I not show references in Visual Studio?

Toggle the CodeLens feature off and then on again. Go into Tools -> Options... -> Text Editor -> All Languages -> CodeLens. Uncheck "Enable CodeLens" option and click OK.


2 Answers

My Solution:

Toggle the CodeLens feature off and then on again.

  • Go into Tools -> Options... -> Text Editor -> All Languages -> CodeLens.
  • Uncheck "Enable CodeLens" option and click OK.
  • Go back into Tools -> Options... -> Text Editor -> All Languages -> CodeLens.
  • Check the "Enable CodeLens" option and click OK.

Note: I've fixed the issue once before by closing the problem .cs file and then reopening it. Closing any referenced files may also be required.

My Problem(s):

Similar to the original poster, CodeLens stopped refreshing references after I made a bunch of refactors. I was seeing stale references to code that didn't exist and I was also seeing the "- references" issue as described in the original post.

My Environment & Specific Scenario:

  • Visual Studio 2015 with Service Pack 2 and Resharper Ultimate 10.0.1
  • I was doing a major overhaul with a ton of refactoring and my project wasn't compilable for an hour or so. Once I could compile the project again, the references weren't working.
like image 182
GrayDwarf Avatar answered Sep 18 '22 11:09

GrayDwarf


Same problem here.
CodeLens works normally with small solutions, but not working with large ones.
And this behavior is accompanied with crash of Alm.Shared.Remoting.RemoteContainer.dll process.
Tried in VS 2013 Update 4 and VS 2013 Update 5 RC.
Solution:
Close all programs and clean %LocalAppData%\Temp folder (or maybe just ALM folder inside it).

like image 34
frobo7 Avatar answered Sep 20 '22 11:09

frobo7