Welcome to MSDN Blogs Sign in | Join | Help
Tip #37: Did you know…How to organize usings?

Overtime C# source code files may have unnecessary & unorganized using directives. Visual Studio IDE organize using options can help you to unclutter the source code.

To organize the C# code right click anywhere inside the code editor, select Organize usings.

  • Select Remove Unused Usings to remove any using directives that are not used in the source code (this may remove some required using directives if the source code doesn't build)
  • Select Sort Usings to organize alphabetically the using directives (by default directives that begin with System comes before other using directives)
  • Select remove and Sort to perform both of the above operations

image

 

Thanks,
Deepak Verma
SDET | Visual Web Developer

Posted: Sunday, December 28, 2008 7:28 AM by WebDevTools

Comments

Mike said:

This IDE macro organizes usings, formats code and adds a file header comment if it's not already there. I assign it to CTRL-Q.

http://blueonionsoftware.com/blog.aspx?p=e40c1a15-6461-4224-b020-c66101bd07ba

# December 28, 2008 9:25 AM

Visual Studio Hacks said:

My latest in a series of the weekly, or more often, summary of interesting links I come across related to Visual Studio. Channel 9 Stuff: XAML Guidelines, Part 2 10-4 Episode 2- Welcome to Visual Studio 2010 Greg Duncan posted a link to the downloads

# December 29, 2008 7:43 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker