Getting rid of unnecessary using statements in Visual Studio 2015

Here comes a quick tip for all of you who are bothered by unnecessary using statements in a class file. You know when you have the automatic “using System.Linq” statement and you never use Linq in that class? It’s a breeze to get rid of those in Visual Studio 2015 using the light bulb icon:

Images

Expand the icon and select “Remove Unnecessary Usings”.

This feature has been available for a long time in NetBeans for Java developers. Visual Studio has finally caught up without having to resort to tools like ReSharper.

Unknown's avatarAbout Andras Nemes
I'm a .NET/Java developer living and working in Stockholm, Sweden.

4 Responses to Getting rid of unnecessary using statements in Visual Studio 2015

  1. lazerducky's avatar lazerducky says:

    Does this have any impact beside aesthetics? I thought they were loaded on demand, so if they aren’t used they aren’t loaded.

  2. neodescorpio's avatar neodescorpio says:

    some extension is already doing this but good to hear now it’s natively supported.

Leave a reply to Andras Nemes Cancel reply

Elliot Balynn's Blog

A directory of wonderful thoughts

Software Engineering

Web development

Disparate Opinions

Various tidbits

chsakell's Blog

WEB APPLICATION DEVELOPMENT TUTORIALS WITH OPEN-SOURCE PROJECTS

Once Upon a Camayoc

ARCHIVED: Bite-size insight on Cyber Security for the not too technical.