Remove unused using statements

Posted by Techie Cocktail | 12:32 PM | , | 0 comments »

In C#, using statements are used to reference namespaces. We tend leave unused spaces as is many times without bothering if any extra using statements are left out. But we do not need to bother at all now because visual studio 2008 has given us one handy option/tool integrated within the VS IDE in the source code unit.

Right click anywhere in the source code unit -> Organize Usings -> Remove Unused Usings.

This removes the unused usings statements, leaving behind the usings references of only those namespaces whose classes are being used in your code.



As seen in the above figure, you can also sort Usings or Remove and Sort both. This option is available both for windows and web projects.

0 comments