25

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.

4

4 に答える 4

16

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

于 2008-10-02T14:37:25.827 に答える
5

TDD + NCover

于 2008-10-02T14:41:06.207 に答える
4

デッドコード(少なくともソリューション内のみ)の場合、ReSharperでは灰色で表示されます...呼び出されていないメソッドやクラス、または未使用のプロパティや変数など

于 2008-10-02T14:38:29.553 に答える
2

繰り返しになりますが、 AQTimeをお勧めします。静的コード分析はすでにあなたが望むこと(そしてもっとたくさん)を行いますが、他のプロファイラーはさらに便利です。あなたがそれを買う余裕があれば、お金の価値があります。

于 2008-10-02T14:40:13.887 に答える