How do I find dead code in a Visual Studio 2008 C# project? Like unused classes, unused variables or unused resources?
You can try FxCop, which is integrated in Visual Studio 2008 by the name of Code Analysis. You just have to right click the project file and 'Run Code Analysis'.
FxCop is an application that analyzes managed code assemblies (code that targets the .NET Framework common language runtime) and reports information about the assemblies, such as possible design, localization, performance, and security improvements.
The active rules can be configured in the Code Analysis section of the project properties. For example some rules relevant to the case in hand are present in Usage Rules and Performance Rules:
And for greater flexibility you also write your own custom rules (Tutorial on writing your own Code Analysis rule).