How can I check in C # if a class property is used in a Visual Studio solution?

I have a C # class with various static public properties that work like keys.

Over time, this class is reorganized many times, and some keys are deprecated and no longer reference other classes from projects in the same Visual Studio solution.

I want to check with reflection or in some other way whether any of these keys (properties) are used in other classes in the Visual Studio solution.

I want to write unit test to find out if any keys are being used.

How could I do this?

+6
source share
1 answer

If you are not using reflection to access the property / class, you can use Shift + F12 or right-click on the property / class / field and select "Find All Links".

This will open the "Find Search Results" window, where you can see all the links to your code element.

+1
source

Source: https://habr.com/ru/post/986722/


All Articles