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

最后都变了- 提交于 2019-11-28 03:52:51
Panagiotis Kanavos

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

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

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.

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.

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

MHDuke

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.

On the Tools tab choose Options.

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

Good Luck!!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!