ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Remove Unused References

Last modified: 11 February 2024

This command allows cleaning up project and assembly references that have no actual usages in your source code. You can apply this command on a project, solution folder, or the entire solution. Before deletion is complete, you will be able to see all references that are going to be removed and if necessary, preserve the ones that you want to keep.

When you remove project and assembly references, ReSharper also deletes all redundant namespace import directives (using in C#, Imports in Visual Basic) that reference namespaces from the removed assemblies.

There are other ways of cleaning project and assembly references.

  • You can invoke the Optimize References command, which will let you analyze all references and remove unused ones.

  • You can expand the References node in the Solution Explorer, select the references you want to remove and invoke the Safe Delete refactoring, which either silently removes unused references or opens a dialog showing how and where the selected references are used.