G Jason Smith
G Jason Smith

Reputation: 93

Is there a quick way to remove using statements in C#?

Is there a quick way to determine whether you are using certain namespaces in your application. I want to remove all the unneccessary using statements like using System.Reflection and so on, but I need a way to determine if I am using those libraries or not. I know that the tool Resharper does this for you, but is there a quick and dirty and Free way to do this?

Upvotes: 6

Views: 1505

Answers (4)

Brian Rasmussen
Brian Rasmussen

Reputation: 116501

I just noticed your vs2008 tag, but for those who don't have VS2008, you can get a similar feature in Resharper.

Upvotes: 2

Anthony Mastrean
Anthony Mastrean

Reputation: 22414

Visual Studio 2008 + PowerCommmands = Remove and Sort usings across a whole solution.

Upvotes: 9

Timbo
Timbo

Reputation: 28080

VS2008 can do this on a per-file basis.

Right-click the source code, select "Organize Usings", "Remove Unused Usings".

Upvotes: 2

Quintin Robinson
Quintin Robinson

Reputation: 82375

Visual Studio 2008 will also do this for you, right click in your class file and select "Organize Usings" -> "Remove and Sort".

Upvotes: 14

Related Questions