Is there a way to find all unused code in a .NET project using ReSharper?

I just did a major overhaul of a coworker project and almost everything was rewritten throughout the process. There used to be too much code.

Now I am left with the prospect that there are old pre-refactoring methods somewhere in my project that are no longer needed.

Is there a way to search the whole project for such methods in one go?

I understand the risk of potentially removing the code used in reflection.

It is very similar to this question , except that I would like to add two additional things:

  • ReSharper specific answer
  • Instructions on how to achieve this using ReSharper as I cannot figure it out.
+2


source to share


2 answers


For the entire solution / project, as far as I know, there is no way to do this with R #. The only way I know is to manually execute the code by pressing Alt + F7 for each method name.



0


source


Use solution analysis .



If you change "Unused declaration" from " Parameters # # / Check level / Code abbreviations / Unused declaration " to " Show as errors ", you will be able to identify all unused declarations.

+8


source







All Articles