Organizing Using Statements - New Feature in Visual Studio 2008
One cool new feature which might not be apparent to us unless and until we really go through all the new features that have been incorporated into the Visual Studio 2008 IDE is the feature which allows us to organize the Using statements that we always use in our source code files. This would be really useful as i have often seen that people use more Using statements than what is actually required, and we always have the habit of adding Using statements as and when required. But at the end of our development process, we would like to do a clean up and make sure that we have put Using statements only for the required namespaces and possibly make it more readable by sorting these statements alphabetically etc.
The Visual Studio 2008 IDE provides the following options to organize and remove usings/imports statements:
- Remove Unused Usings
Removes using directives, using aliases, and extern aliases that are not used in the source code. - Sort Usings
Improves the readability of the source code by alphabetizing and organizing using directives, using aliases, and extern aliases in the following order: - extern aliases
- using directives
- using aliases
- Remove and Sort
Does both removal as well sorting discussed above.

To see the available options in the Visual Studio IDE, on the Edit menu, point to IntelliSense, and then point to Organize Usings. An easier way to do this would be to Right-click anywhere inside the code editor, point to Organize Usings as shown in the figure above and click on any of the 3 options available.
For more information on this feature please read this msdn article.
A very small but useful feature indeed!
