Visual Studio 2017: Display method references

守給你的承諾、 提交于 2019-12-02 16:32:40
ISHIDA

In Visual Studio Professional or Enterprise Enable CodeLens by doing this-

Tools → Options → Text Editor → All Languages → CodeLens

This is not available in the Community Edition

No luck with Code lens in Community editions.

Press Shift + F12 to find all references.

CodeLens is not available in the Community editions. You need Professional or higher to switch it on.

In VS2015, one way to "get" CodeLens was to install the SQL Server Developer Tools (SSDT) but I believe this has been rectified in VS2017.

Still you can get all method reference by right clicking on the method and "Find All references"

For display references on the top of method you have to enabled the CodeLens option in Visual Studio Professional and Visual Studio Enterprise.

Use below steps to enabled it.

1. Go to Tools and then select Options :

2. Then Select Text Editor -> All Languages -> CodeLens

3. Click on check box to Enable Code Lens:

Now you can see the references on the top of methods.

This will not work for VS - Community Edition

Cheers!

For anyone who looks at this today after 2 years, Visual Studio 2019 (Community edition as well) shows the references

In previous posts I have read that this feature IS available on VS 2015 community if you FIRST install SQL Server express (free) and THEN install VS. I have tried it and it worked. I just had to reinstall Windows and am going thru the same procedure now and it did not work... so will try again :). I know it worked 6 months ago when I tried.

-Ed

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