简体   繁体   中英

Is there a quick way to remove using statements in C#?

Is there a quick way to determine whether you are using certain namespaces in your application. I want to remove all the unneccessary using statements like using System.Reflection and so on, but I need a way to determine if I am using those libraries or not. I know that the tool Resharper does this for you, but is there a quick and dirty and Free way to do this?

Visual Studio 2008也将为您执行此操作,右键单击您的类文件并选择“组织使用” - >“删除并排序”。

Visual Studio 2008 + PowerCommmands =在整个解决方案中删除和排序使用。

VS2008 can do this on a per-file basis.

Right-click the source code, select "Organize Usings", "Remove Unused Usings".

我刚注意到你的vs2008标签,但是对于那些没有VS2008的人来说,你可以在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