Removing Unused References in Visual Studio 2010

The C# IDE lets you easily clean up your .cs files’ using sections by right-clicking in the editor and selecting “Remove and Sort Usings”. Unfortunately, there is no such command for removing unnecessary assembly references from a project.

Searching SO brought up some answers regarding free tools implementing this operation, and the Visual Studio Gallery website contains at least 3 VS Extensions that provide this functionality:

Judging from the reviews pages of each product, all of them seem to share the problem that sometimes they remove assemblies even though they are required for compilation.

(This problem may occur if code in assembly 1 calls assembly 2 which returns an object defined in assembly 3, but assembly 3 is not referenced by assembly 1.)

Reference Assistant has a preview of the remove operation (screenshot), but I am not sure about the other products.

What is your preferred tool for this operation?

2 Responses to Removing Unused References in Visual Studio 2010

  1. QA says:

    I tried three of them and and it seems that Muse.VSExtensions is much faster

  2. […] favorite reference removal tool, Reference Assistant, only target Visual Studio 10 (2010) and 11 (2012), according to the […]

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: