Hartmut's BoxHartmut Wilms’s Weblog

« Dezember 2007 | Main | Februar 2008 »


Visual Studio 2008 Tip: Resolving Namespaces and Removing Unused Using Statements

For quite some time I’ve been wondering why Visual Studio still doesn’t meet the minimal requirements of development productivity. Features such as resolving namespaces, finding classes and automatically resolving namespaces and navigating to the definition of a class by simply pressing STRG and clicking the left mouse button, which are offered by about every JAVA IDE, are missing. Instead Visual Studio 2008 presents #1001 of the most annoying wizards ever.

ReSharper comes to the rescue, but it doesn’t support C# 3.0, yet. David Hayden shows how to get along with Visual Studio 2008 regarding namespaces:

It turns out, Visual Studio 2008 actually has good support for resolving namespaces and optmizing using statements that can get you the functionality if you are not using ReSharper.


Pressing Ctrl + . will bring up a context-sensitive menu that allows you to add a using statement or optionally fully qualify the path to the class.


The other nice thing that ReSharper does is remove unused using statements using Ctrl+Alt+O.

We can get that using Visual Studio 2008, because you may have noticed the cool context-sensitive Organize Usings Option:

Visual Studio 2008 Organize Your Usings


I’ve quit hoping for something like “Call Hierarchy” within Visual Studio or at least ReSharper, but David’s tip saved me from uninstalling VS 2008.

Posted by Hartmut Wilms at 21:08 | Comments (1)