ChatGPT解决这个技术问题 Extra ChatGPT

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

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

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

https://i.stack.imgur.com/3rg7L.png

Here is a screenshot of Visual Studio 2013:

https://i.stack.imgur.com/jpSiE.png

source: dailydotnettips.com

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?
@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.
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?
double click a method and Ctrl K + R and you get a poormans version of that but i do miss it dearly as well!
That's so bad - even the free Visual Studio Code can show the references and is able to click on it :-(

R
R. Richards

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

https://i.stack.imgur.com/XoXm5.png


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.
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.
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.
@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
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.
U
Urielzen

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


Another person have also the community version of VS but he has the reference count!
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.
Strangely enough, it showed up in my "VS2015 Community" after I installed SQL Server Management Studio 2016.
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
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?
J
Jimmy Shaw

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.


I installed vs-2015-upgrade3 + SSDT and CodeLens appeared like magic
Same here, Installed VS 2015 Community with Upgrade 3 and I have CodeLens.
Could this simply be a plot to have users install SSDT?
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/…
佚名

On the Tools tab choose Options.

https://i.stack.imgur.com/nRoGO.png

Good Luck!!!


is this a visual studio community version? i can not see these extra options on codelens
It's Professional Version.
p
pius

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.


P
Peter

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


H
H. Pauwelyn

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.