How to easily find unused public methods / properties

I have a .Net (C #) solution. The solution contains many projects. The projects were not implemented by me. This is not a framework, it means that I need as few public methods / properties as possible. My task is to define methods and properties that are not used, but exist in projects. Well, I can find private methods that are not used with R #. But it is completely unclear how to find public methods / properties that are not used.

I heard that they have an NDepend tool, but this is not a very simple tool, is it.

So, the question arises: could you point to a tool that can be used to identify methods that are not used in the solution. It's ok with me to have a command line tool or something pretty simple.

UPD: I tried to use the trial version of NDepend.

Well, first of all, it seems that you can see public methods (properties are presented as get_ set_ methods) that are not used in this particular assembly.

But NDepend does not recognize if a public method is being used from another project / assembly, which is part of the solution and shows the method as unused. But this is not so.

UPD2: mcintyre321 is recommended to use R #. Please read the first comment below.

+6
methods properties refactoring public-method
source share
2 answers

If you enable analysis of a wide range of solutions in ReSharper (5.0 and above), it will mark them for you. This includes publicly available methods.

+7
source share

Damn, I did it in the old school. I am just commenting on methods that, it seems to me, are not used and are not built. If I get an error message, I leave it there.

+2
source share

All Articles