Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 505
Chris S Avatar asked Nov 28 '22 02:11

Chris S


1 Answers

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.

like image 124
Winston Smith Avatar answered Nov 29 '22 16:11

Winston Smith