The Code Lens feature of Visual Studio 2013 won't work anymore. It says "Loading references for this method" but it takes years and actually it doesn't load them for any method at all.
It used to be working just fine but I am not sure why it stopped working. I restarted Visual Studio 2013 many times, I even restarted my computer but no luck.
It is enabled in my Visual Studio 2013.
Microsoft Visual Studio 2013 has a new feature called Code Lens which shows the reference count of the methods along with the other information like Show Authors, bugs, work items etc.
February 12, 2017 Wade Anderson, @waderyan_. CodeLens is a popular feature in Visual Studio Code. The essence of the feature is "actionable contextual information interspersed" in your source code.
I found out that if you block the Visual Studio with the Firewall, the Code Lens did not work. So unblock it from the firewall to make it work. CodeIndexing must be enabled on the TFS Server. You can check this setting using TFSConfig:
Alternatively, if you have the class file opened, just right click on indicators and click “Code Lens” options to display the same screen as shown above to disable it.
I will answer my own question as I managed to solve it.
It seems each time you run your tests in Visual Studio, it stores the result of your tests in TestResults folder in the project folder and it was about 800MB in size in my computer.
I just deleted it and clean the project bin and obj folders as well (which I did for several times before and didn't really work). But removing TestResults folder did the magic.
My guess is that because of the humongous size of the TestResults folder, Visual Studio 2013 cannot load all the results etc. quickly and that's why it was taking years to show me Code Lens feature. So delete that folder time to time for better performance.
Here are some results about TestResults folder after I googled it:
UPDATE
Even if those methods above may work for you, I realized that they actually fixed this issue since Visual Studio 2013 Update 2. So instead, please update and install it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With