C# .NET - .Net Tool

Asked By Lokesh M on 04-Jan-12 01:55 AM
Hi,

Our .NET solution consists of 13-15 C#.net Project, quite a big and old project.

Would like to know if any tools available in .NET which helps us to list the unused methods and/or unused references etc.

Would like to do code cleanup, before moving to production.

Regards
Lokesh.
Jitendra Faye replied to Lokesh M on 04-Jan-12 01:57 AM

Yes, ReSharper does this.

Right click on your solution and selection "Find Code Issues". One of the results is "Unused Symbols". This will show you classes, methods, etc., that aren't used.

And you don't have to buy NDepend.

Suchit shah replied to Lokesh M on 04-Jan-12 02:04 AM
I would suggest you to 1st of all check in your application it self... once you load project in visual studio and go to check the warning.... then warning message would tell it self abount unused rerences.... so some of the task would be easier to find from warning message it self from project it self

2nd 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.


So you can try that one too
Srikanth K replied to Lokesh M on 04-Jan-12 04:20 AM
The unused references problem is common and can’t be avoided during the development of application, as we create classes and modify them multiple times in a code file which results in invalid references to assemblies. But what is required before compiling a project is to remove all the unused references to assembly. Reference Assistant adds itself to Project right-click http://www.addictivetips.com/tag/context-menu in Solution Explorer to find and delete the invalid references from project’s code files.

Before installing the extension, make sure that Visual Studio is not running in background. Now run the VSIX file to install the extension and then launch Visual Studio. Now open the project which contains unused references. In Solution Explorer, right-click the project and select Remove Unused References option.

It will show all the unused references present in your project files. Select the references you want to delete and click OK to begin removing them from your project.

The Reference Assistant uses Output Console to show the results. It’s advised to verify the unused references which were removed during the process. Reference Assistant works only on Visual Studio 2010.

http://visualstudiogallery.msdn.microsoft.com/fc504cc6-5808-4da8-ae86-8d3f9ed81606


kalpana aparnathi replied to Lokesh M on 04-Jan-12 04:30 AM
hi,

http://www.jetbrains.com/resharper/documentation/reviewers_guide.html#code_cleanup