Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using visual studio 2010 and was wondering if there is a way to automatically remove all the namespaces that aren't being used at the the top of the page e.g.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;

in the above example System.Collections.Generic is not being used is there a way to know that without trial and error.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
179 views
Welcome To Ask or Share your Answers For Others

1 Answer

Yes you can right click on the page and from the menu select;

Organise Usings > Remove Unused Usings

Alternatively if you prefer shortcuts, please use;

Ctrl + R + G

I am using this all the time, to clean up code, and make code compilation quicker.

Or you can use PowerCommands to remove unused usings for entire projects


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...