#758 – Cleaning Up using Directives in a File
January 15, 2013 1 Comment
using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text;
Extra using directives don’t hurt anything–the list of directives is just a list of possible namespaces to consult when resolving a name. Your code may not actually reference members in all of the listed namespaces.
For cosmetic purposes, however, there is an easy command in Visual Studio that you can use to clean up using directives for namespaces that you don’t use.
To remove unused namespaces, you can right-click in the source code editor and select Organize Usings and then Remove Unused Usings. After you do this, you’ll be left only with namespaces that contain members that your code contains.