What tools and techniques do you use to find dead

2019-01-09 00:49发布

问题:

What tools and techniques do you use to find dead code in .NET?

In the past, I've decorated methods with the Obsolete attribute (passing true so the compiler will issue an error, as described in MSDN).

I'd be interested in seeing the suggestions of others (beyond tools like FxCop or ReSharper). I want to make sure I'm not missing out on other tools that would be helpful.

回答1:

TDD + NCover



回答2:

Why do you need other answers? FxCop and Resharper do the trick, especially seeing as FxCop is now integrated into VS through "Code Analysis".



回答3:

it appears gray in ReSharper if it's dead code (at least within the solution only)...like uncalled methods or classes or unused properties and variables



回答4:

Once again, I recommend AQTime. The static code analysis already does what you want (and a lot more), but the other profilers are even more useful. Worth the money, if you can afford it.