Chris S
Chris S

Reputation: 65476

Removing redundant using statements

Does anyone know of a tool to remove redundant using statements from classes, or a whole solution?

I'm using the Refactor! addin which has a "move type to separate file" smart tag, but it takes all the using clauses from the original class with it.

Upvotes: 4

Views: 797

Answers (4)

RichardOD
RichardOD

Reputation: 29157

PowerCommands for Visual Studio upgrades the default VS.NET 2008 functionality of "Remove Usings" to an entire project or solution.

I use it all the time. It also has a lot of other useful features- check it out.

Best of all it is FREE.

Upvotes: 9

Winston Smith
Winston Smith

Reputation: 21932

VisualStudio 2008 does this out of the box.

Simply right click in the code window -> Organise Usings -> Remove Unused Usings.

You can set up a shortcut key to do this, as explained here.

Upvotes: 12

Philippe Leybaert
Philippe Leybaert

Reputation: 171914

Resharper does this pretty well.

Upvotes: 10

Mitch Wheat
Mitch Wheat

Reputation: 300827

ReSharper does this.

Upvotes: 4

Related Questions