This project was developed at 2011 and originally hosted by codeplex. I'm not working on the project anymore.
Reference Assistant is free, open source tool to remove unused references from C#, F#, VB.NET or VC++/CLI projects in the Visual Studio 2010/11. It's developed in C#.
Often a .NET project has some references that are not used by any types of its project.When creates new project, the Visual Studio adds several assemblies by default. Types from these assemblies can be used in the future. How to detect what assembly reference is useful and what is not? Simplest way checking the used types. But what if a project is so big? Well it is possible to check an assembly manifest. Yes, assemblies references which are required for runtime will be included in the manifest. But there is one more problem. The assembly can be required indirectly. For example, if you use some type then all assemblies containing definitions of its base types (classes and interfaces from type's hierarchy) should be in a project's references. It is just one example. The Reference Assistant checks several criterions to decide to remove assembly reference or not:
- checks a project assembly's manifest (for VC++/CLI doesn't check);
- checks the hierarchy of used classes;
- checks the hierarchy of used interfaces;
- checks the used attributes and their parameters types;
- checks the forwarded types(some type can be moved from one assembly to another);
- checks the imported types (e.g. COM types);
- checks the used members of types (methods, properties, fields, events) and them parameters types;
- checks the types declared in XAML (Silverlight, WPF, Workflow 4.0, Windows Phone)
The Reference Assistant uses the Mono.Cecil library for reading assembly metadata.
The Reference Assistant is available for downloading on the Visual Studio Gallery:
If you want to change the Reference Assitant's source code for yourself and to compile it after that, you need to install Visual Studio SDK. You can download it there:
- Visual Studio 2010 SDK - if you HAVE NOT the installed Service Pack 1 for the Visual Studio 2010.
- Visual Studio 2010 SP1 SDK - if you HAVE the installed Service Pack 1 for the Visual Studio 2010.
- Visual Studio 11 Beta SDK - if you develop for Visual Studio 11
- Microsoft F# - Visual Studio integration for F# development