Skip Navigation LinksHome > View Post

Resolve function in Visual Studio 2005

Well I never. I've just returned from the WinFX MSDN Roadshow in Manchester and the thing I love most about these events is that I always come away with some little tidbits that I wasn't expecting, like this one from Mike Taulty's presentation on WinFlow (the cool name for Windows Workflow Foundation).

Back in the day, when I used to use Visual Studio 2003 with ReSharper, I used to love the function that automatically added using statements to the top of my file whenever I declared a variable of type that wasn't appropriately qualified, e.g.

using System;

public class Example
{
    public static void Main()
    {
        // this won't compile because I need a 'using System.IO';
        FileStream fs;
    }
}

That particular feature of ReSharper was probably the thing I missed most when I moved to the VS2005 IDE.

Well, it turns out that VS2005 contains the same functionality, it's just not as discoverable. Type the name of a class that you haven't yet included the appropriate using statement for and right-click on the name.

Visual Studio 2005's resolve function

You'll get an extra couple of menu items that allow you to either add the appropriate using statement or change the declaration to be fully qualified, as shown above.

Awesome.

UPDATE - In the comments, Brian Russell shows that there's even a keyboard shortcut available.

Tags: .NET

 
Josh Post By Josh Twist
7:12 AM
07 Jun 2006

» Next Post: SSIS Set Variable Custom Task
« Previous Post: SSIS and reusing tasks within packages

Comments are closed for this post.

Posted by Brian Russell @ 07 Jun 2006 8:54 AM
Or, instead of right-clicking, you can do a Ctrl + Period, then hit enter.

By period, I mean the symbol on the end of this sentence.

So type FileStream, but right after you type the m, look for the word to have a underline. When that is there, you can do the Ctrl + Period to bring up the quick access menu.

© 2005 - 2014 Josh Twist - All Rights Reserved.