Missing CodeLens references count in Visual Studio Community edition 2015 and 2017

89,494

Solution 1

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

Solution 2

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

Solution 3

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.

Solution 4

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.

Solution 5

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.

Share:
89,494
H. Pauwelyn
Author by

H. Pauwelyn

I'm H. Pauwelyn, I'm working as software and web engineer at Savaco loving AI, robotics, new media, IoT, domotics, the cloud and Lego. The most common programming languages I use are C#, JavaScript, TypeScript and SQL.

Updated on July 19, 2020

Comments

  • H. Pauwelyn
    H. Pauwelyn almost 4 years
    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

  • H. Pauwelyn
    H. Pauwelyn over 8 years
    Another person have also the community version of VS but he has the reference count!
  • Panagiotis Kanavos
    Panagiotis Kanavos over 8 years
    Are you sure about this? Did you ask them? Before downvoting, did you check Microsoft's official page? Perhaps that other person actually has Pro, or used a hack to install CodeLens on VS Community. Or perhaps it's a Preview version of the Pro edition, not Community
  • H. Pauwelyn
    H. Pauwelyn over 8 years
    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.
  • qxg
    qxg over 8 years
  • Panagiotis Kanavos
    Panagiotis Kanavos over 8 years
    @qxg Evidence of what? There's no doubt that CodeLens is not available in the Community Edition. In fact, the editions & licensing pages are more valid than the documentation pages - one can argue that a documentation page is slightly out of date. You can't do that with the product pages
  • qxg
    qxg over 8 years
    @Panagiotis Kanavos, I didn't disagree with you. Just open that link.
  • Panagiotis Kanavos
    Panagiotis Kanavos over 8 years
    I did. I'm just saying that MS can (and has in the past) claim that a documentation page is out of date. They can't do that with the editions page though - any discrepancy would be instant news. Although, this page shows that they tried to make it crystal clear that CodeLens is not in Community by putting a warning box at the top of the relevant pages
  • balajikris
    balajikris over 8 years
    Panagiotis is right. Codelens is available only from Pro edition and above.
  • Bas Jansen
    Bas Jansen over 8 years
    I just listened to .Net Rocks episode "Building Visual Studio Code with Sean McBreen". In this episode Sean says that CodeLens is available in VS Code and in the Community edition of Visual Studio. Now I'm totally confused,
  • Stewart_R
    Stewart_R over 8 years
    It's definitely available in VS Code. Now they open sourced VS Code surely it can find it's way into VS Community Edition?
  • Panagiotis Kanavos
    Panagiotis Kanavos over 8 years
    @Stewart_R where did you read that? Nothing like that was announced in Connect 2015. VS Code is a completely different application - in fact it's written in TypeScript. Whatever functionality is implemented there has nothing to do with CodeLens
  • Stewart_R
    Stewart_R over 8 years
    @PanagiotisKanavos I didn't read it. I opened a C# file in VS Code and there it was...
  • Panagiotis Kanavos
    Panagiotis Kanavos over 8 years
    @Stewart_R are you mistaking CodeLens with Intellisense perhaps?
  • Stewart_R
    Stewart_R over 8 years
    @PanagiotisKanavos Nope. Maybe give it a try for yourself, perhaps?
  • Panagiotis Kanavos
    Panagiotis Kanavos over 8 years
    @Stewart_R are you referring to this? The marketing name may be the same but this is not the same feature (libraries, code, interfaces) as the one in Visual Studio. It works only for DNX projects and displays only reference info, when VS would display reference, source control, test results and any other information provided by additional CodeLens addins.
  • Stewart_R
    Stewart_R over 8 years
    @PanagiotisKanavos Yes - I am referring to that. Its called CodeLens and looks exactly like the OP's screenshot, therefore CodeLens IS available in VS Code, right? Thanks for your insight into how CodeLens is implemented in a different way in VS Code with fewer features..
  • Doug Null
    Doug Null about 8 years
    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.
  • JohnTube
    JohnTube about 8 years
    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.
  • tsohtan
    tsohtan almost 8 years
    Yes it's work with update 2, you need to install all SQL Server x Services like JohnTube mentioned
  • Dan Ware
    Dan Ware almost 8 years
    Strangely enough, it showed up in my "VS2015 Community" after I installed SQL Server Management Studio 2016.
  • Panagiotis Kanavos
    Panagiotis Kanavos almost 8 years
    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 SSDT, possibly to allow CodeLens to work with database projects
  • Panagiotis Kanavos
    Panagiotis Kanavos almost 8 years
    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
  • mausworks
    mausworks over 7 years
    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.
  • Zakos
    Zakos over 7 years
    I installed vs-2015-upgrade3 + SSDT and CodeLens appeared like magic
  • Almir Vuk
    Almir Vuk over 7 years
    Same here, Installed VS 2015 Community with Upgrade 3 and I have CodeLens.
  • Jimmy Shaw
    Jimmy Shaw over 7 years
    Could this simply be a plot to have users install SSDT?
  • Nick
    Nick over 7 years
    Doesn't seem to work with VS 2015 Community Update 3 on Windows 8.1. I've tried installing (one at a time) full old/preview SSDT, full latest SSDT, partial SSDT (SSIS only), SSMS, but nothing enables CodeLens anymore. Maybe these work-arounds have effect on Windows 10 only?
  • remotedeveloper
    remotedeveloper over 7 years
    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?
  • MRainzo
    MRainzo over 7 years
    @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
  • Gelásio
    Gelásio over 7 years
    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.
  • madannes
    madannes about 7 years
    The screenshot was what I was looking for.. but only because I was too blind to see the search box in the Options screen =D
  • SolidSnake4444
    SolidSnake4444 about 7 years
    Does this still work in 2017? I see comments stating that this doesn't work as of Nov of 2016. Is that the case?
  • radbyx
    radbyx about 7 years
    It works and the option can be found the same place for VS2017. I just did it.
  • R. Richards
    R. Richards about 7 years
    @YuvalLevy according to the comments above, yes.
  • Jenix
    Jenix almost 7 years
    The link isn't preview or RC version anymore and doesn't work for me. Mine is Windows 7 64bit and VS 2015 Community Update 3..
  • Jimmy Shaw
    Jimmy Shaw about 6 years
    Be sure to download the correct SQL Server Data Tools package for your specific version of Visual Studio: docs.microsoft.com/en-us/sql/ssdt/…