简体   繁体   中英

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.

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 .

Resharper做得很好。

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.

ReSharper做到了这一点。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM