0

I would like to have a tool: which finds and indicates unreferenced public properties in C# classes.

I tried RuleSet, CodeMaid and StyleCop already but I did not find the corresponding option.

Is there a tool for this or is there an option which I missed with the tools enumerated above?

Is Resharper applicable for this ? I rather use a free tool btw...

What would you implement to solve this problem? I thought about a Visual Studio extension which calls the find all references for every public property in class and leaves an obsolete attribute above the property if it doesn't have any references. Is it possible?

But I think there should be an easier way which I miss.

Thanks in advance :)

inZuLiN
  • 11
  • 3
  • yes, ReSharper is capable of this (https://stackoverflow.com/questions/245963/find-unused-code). I don't use any other extensions so can't help U with free tools. U can also write your own Roslyn analyser that will find such places, I think that should not be really hard. – Shpand Sep 02 '21 at 08:35
  • https://docs.devexpress.com/CodeRushForRoslyn/401604/static-code-analysis/unused-code-analysis – Gehan Fernando Sep 02 '21 at 08:36
  • Try these suggestions: https://stackoverflow.com/questions/30974433/get-list-of-zero-reference-codes-in-visual-studio – Koray Elbek Sep 02 '21 at 08:53

0 Answers0