Remove namespace or full names


My question is if there is any shortcut, command or function of Visual Studio that removes the namespace or full names of classes, for example: to add a Data Annotation without making a using you have to put the complete namespace System. (), But after you make a using in the System.ComponentModel.DataAnnotations namespace you only need to put Required ().

So what I want is, in a class that was used namespace along with classes and was not done using, after I do the usings I want to remove the namespace from the code, to stay clean.

But if I do this in the hand I will have a lot of work and I wanted to know if VS does it quickly and automatically.

asked by anonymous 22.05.2015 / 15:41

1 answer


The refactoring functionality of VisualStudio is very limited, but with ReSharper you can do this:


Refactor - > Remove unused references

or else, simply Cleanup code (Ctrl + E, Ctrl + C)

22.05.2015 / 16:50