Reputation: 14280
Here is a screenshot of Visual Studio 2015 and 2017 Community edition:
Here is a screenshot of Visual Studio 2013:
source: dailydotnettips.com
Upvotes: 95
Views: 94403
Reputation:
On the Tools tab choose Options.
In the open window choose like bellow, and then press ok.
Good Luck!!!
Upvotes: 17
Reputation: 131334
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
Upvotes: 76
Reputation: 148
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.
Upvotes: 1
Reputation: 25151
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
Upvotes: 129
Reputation: 61
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
Upvotes: 1
Reputation: 2424
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.
Upvotes: 10
Reputation: 1317
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.
Upvotes: 23