Good tools to find dead C# code...
-
I want to clean up my projects C# source code by removing things (unused functions, variables, parameters etc) which are no longer being used. ;) I could find a tool for VB [^] but not for C# yet. Can anybody recommend me a good one?
-
I want to clean up my projects C# source code by removing things (unused functions, variables, parameters etc) which are no longer being used. ;) I could find a tool for VB [^] but not for C# yet. Can anybody recommend me a good one?
Visual Studio 2005 includes a static analysis tool that may do the trick. This was previously known as FxCop (well, still is) and is available on http://gotdotnet.com[^]. The important thing to keep in mind, however, is if other assemblies are using that functionality. If you've exposed such entities publicly and you're assemblies are used by third-parties you should go a version or two using the
ObsoleteAttribute
on those entities and eventually removing them. This will help third-parties maintaining their code to know that soon that functionality will be non-existant in future versions. If this code is being used by COM clients do not change interfaces that have already been published. This violates certain rules of COM that make allow for newer implementations to implement older interfaces that older clients know about and can use without breaking. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog] -
I want to clean up my projects C# source code by removing things (unused functions, variables, parameters etc) which are no longer being used. ;) I could find a tool for VB [^] but not for C# yet. Can anybody recommend me a good one?
What about NCover, its primarily used to check for test coverage but can be used for your purposes too I think
-
I want to clean up my projects C# source code by removing things (unused functions, variables, parameters etc) which are no longer being used. ;) I could find a tool for VB [^] but not for C# yet. Can anybody recommend me a good one?