.net News Letter

Remove Unused namespaces

C# Organize Usings (Visual Studio)


In your C# program, you have a list of using directives at the top that allow you to access types easily. These may be in any order, but to make reading them easier, alphabetizing them is important. In this article, we take a look at the Organize Usings feature in Visual Studio 2010.
Organize Usings

Steps

To use the Organize Usings feature, right-click anywhere on the using directives and select Organize Usings. In these examples, we see the initial program. Then, we see the program with the Remove Unused Usings option invoked. Finally, we see the program with the Remove and Sort option used.

Comments