Captain Comic
Captain Comic

Reputation: 16196

Need to analyze C# code to find unreferenced classes

I have legacy C# code and I am using Visual Studio 2008. I am looking for a tool, sort of code-analyzer that would say to me which class are not used and also some other useful information that might useful for code optimization.

If there is exact duplicate please specify.

Thank you.

Upvotes: 5

Views: 659

Answers (4)

Daniel Elliott
Daniel Elliott

Reputation: 22857

ReSharper (r#) has something of the sort.

Upvotes: 2

Ira Baxter
Ira Baxter

Reputation: 95334

The C# Test Coverage tool will tell you which code blocks (methods) are not executed during any single (or set) of runs. If you exercise your code thoroughly, blocks not executed are strong candidates for dead code.

Upvotes: 1

Simon Linder
Simon Linder

Reputation: 3428

I recommend FxCop.

Upvotes: 1

Guillaume
Guillaume

Reputation: 13138

Have a look at NDepend.

Upvotes: 8

Related Questions