A lot of people don’t know this but you can actually clean up your using statements in your Visual Studio projects almost automatically.
In case you didn’t know, here is how to do it:
You have a big list of using statements in your class. It might look like this by default:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes;
Just do a right-mouse click on the using statements and select:
[Organize Usings] > [Remove and Sort].
This will remove all the unnecessary and unused usings. The result might look as clean as this:
Sometimes, nothing could be removed or sorted but in most new class files there are a lot of default usings. It might be good to clean them once in a while, especially if you wrote and removed lots of (test) code in a class.
Happy programming 😉