95
  1. Is there a reason why the references count (code lens) is missing in Visual Studio Community edition?
  2. Is is possible to enable it in the options?

Here is a screenshot of Visual Studio 2015 and 2017 Community edition:

methods without code lens

Here is a screenshot of Visual Studio 2013:

methods with code lens

source: dailydotnettips.com

7
  • 5
    I know it's been said codelens is not available to VS Community, but on my work machine it somehow showed up for me, and I also use VS Community on a home computer and it is lacking it, I don't know how I got it to show up at work. Anyone else seen codelens showing up on their VS Community?
    – Ray
    Commented Jan 22, 2016 at 23:09
  • @fanray: 1) Have you maby another version of VS with codelens installed on your pc? 2) A person I know has also VS Community with codelens. Commented Jan 23, 2016 at 10:17
  • yeah I actually have 2013 Pro installed on that machine, do you or anyone by chance know how to get codelens to show up without another installation besides VS Community?
    – Ray
    Commented Feb 16, 2016 at 17:50
  • 2
    double click a method and Ctrl K + R and you get a poormans version of that but i do miss it dearly as well!
    – Andy
    Commented Sep 27, 2016 at 20:36
  • That's so bad - even the free Visual Studio Code can show the references and is able to click on it :-( Commented Aug 23, 2017 at 14:54

7 Answers 7

128

I installed the latest SSDT preview for Visual Studio 2015 from the link below on 2 machines I have with VS 2015 Community edition (Update 1), and CodeLens started working for all my projects.

https://msdn.microsoft.com/en-us/library/mt204009.aspx

enter image description here

13
  • 5
    Shazaam! This solution worked. I now have references above each function in vb.net in my VS 2015 Community. References are awesome because a single click takes you from a function to any other function that calls that function. Saves time.
    – Doug Null
    Commented Mar 18, 2016 at 12:57
  • 2
    I wanted to add that CodeLens is included in one of the extra SQL Server x Services bundled with the DB. Do not untick anyone to make sure you have what you want. I had to modify installation because I unticked them all the first time.
    – JohnTube
    Commented Mar 30, 2016 at 10:35
  • 5
    To be precise, you only need to install "SQL Server Integration Services". Along with the mandatory "SQL Server Database" i.imgur.com/XFWFf85.png. I think it's part of the "Microsoft Visual Studio Tools for Applications 2015 Language Support"-package, but I base that of a hunch.
    – mausworks
    Commented Sep 10, 2016 at 15:57
  • 1
    @Nick it doesn't seem to work anymore. But I have another laptop on Windows 10, VS2015 community and codelens. I'm guessing MS fixed this on newer VS 2015 community installs
    – MRainzo
    Commented Nov 13, 2016 at 20:33
  • 3
    After install SSDT as with your link (SQL Server Data Tools (17.0 RC1)) it continues to NOT APPEAR. Neither in code or Options >Text Editor > All Language =( I have the Update 3.
    – Gelásio
    Commented Nov 23, 2016 at 10:19
76

This isn't a generic reference counting feature, it's just one of the features of CodeLens. CodeLens is only available in Visual Studio 2015 Pro and above. In Visual Studio 2013 it was a Ultimate-only feature.

UPDATE

As others have noted, installing SSDT or SSMS 2016 may enable CodeLens as well. That's because VS 2015 Community is Pro, with a different license and some missing extensions like CodeLens. As long as an extension's binaries and settings are installed, Community will activate the extension.

UPDATE 2019

"CodeLens has been a feature found only in Visual Studio Enterprise, but that will change in an upcoming preview of Visual Studio 2019, when it will also be available for the Community edition, likely in 2019" What's New in Visual Studio 2019

19
  • 4
    Another person have also the community version of VS but he has the reference count! Commented Oct 15, 2015 at 9:42
  • 1
    Yes 100% sure. I have also seen in your link and indeed you have right. but there is someone that has it with the community version. Commented Oct 15, 2015 at 10:09
  • 2
    Strangely enough, it showed up in my "VS2015 Community" after I installed SQL Server Management Studio 2016.
    – Dan Ware
    Commented Jun 21, 2016 at 19:32
  • 3
    VS Community is VS Pro. If an extension's settings and binaries are there, the extension will work. Codelens obviously isn't packaged with VS Community but it is packaged in SSMS, possibly to allow CodeLens to work with database projects Commented Jun 22, 2016 at 7:28
  • 8
    I have installed SSDT and SSMS 2016 and CodeLens still won't show up in my VS community. Any other ways to get CodeLens in community? Commented Nov 12, 2016 at 5:18
23

I have Visual Studio 2015 Community edition and it originally did NOT have CodeLens.

However, after going to Tools -> Extensions and Updates -> Product Updates and then downloading SSDT and installing all options within the SSDT package, my VS 2015 Community Edition now miraculously has access to CodeLens.

4
  • 2
    I installed vs-2015-upgrade3 + SSDT and CodeLens appeared like magic
    – Zakos
    Commented Sep 22, 2016 at 9:00
  • 1
    Same here, Installed VS 2015 Community with Upgrade 3 and I have CodeLens.
    – Almir Vuk
    Commented Sep 22, 2016 at 13:02
  • 2
    Could this simply be a plot to have users install SSDT?
    – Jimmy Shaw
    Commented Oct 24, 2016 at 1:17
  • Be sure to download the correct SQL Server Data Tools package for your specific version of Visual Studio: learn.microsoft.com/en-us/sql/ssdt/…
    – Jimmy Shaw
    Commented Feb 6, 2018 at 22:03
17

On the Tools tab choose Options.

In the open window choose like bellow, and then press ok. Example

Good Luck!!!

3
  • is this a visual studio community version? i can not see these extra options on codelens Commented Sep 15, 2019 at 23:28
  • 1
    It's Professional Version.
    – user11116003
    Commented Sep 16, 2019 at 7:00
  • Mine is community, and this solution solved the problem (I do not see the same list as the one in the screenshot, but references count now shows up)
    – Veverke
    Commented Jan 4 at 13:13
10

This feature has been disabled in Visual Studio Community 2017, although it sounds like it was temporarily available in pre-release versions.

The Visual Studio Team issued this statement on the 14th of March 2017:

An authoring error in the SQL Server Data Tools resulted in the capability temporarily showing up incorrectly in Visual Studio Community when installed; the change you see is a result of correcting that mistake.

Also, on the Compare Visual Studio 2017 Offerings page CodeLens appears to not be available in the Community edition.

1

I'm not allowed to Comment on R. Richards answer above, so posting this as a separate answer: CodeLens references disappeared for me too when I upgraded my VS Pro to 2017. But only on my Desktop ("same" upgrade behaved differently on my laptop, where CodeLens settings apparently unaffected). Anyway, very easy to resolve just Enable CodeLens under Text Editor : All Languages

1

An alternative is to just right-click the member and select 'Find All References' or the hot key shift + F12*. Not only you will find the count of references grouped by project, but also the underlying code lines and their classes.

* As per Visual Studio 2017 Community.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.