views:

386

answers:

3

Is there a way in Visual Studio (a hotkey) to automatically import a type (or choosing between known namespaces) like the CTRL+O in Eclipse?

+1  A: 

Look at JetBrain's excellent Resharper product. It does this for you.

Andrew
+2  A: 

When the red caret appears at the end of your member, just hit SHIFT+ALT+F10, then use arrows keys to choose the right option.

controlbreak
That doesn't automatically add the right 'using' declaration though. Resharper will.
Andrew
tried and never seen. thnks
Enreeco
Seems buggy under VB.NET :-/
controlbreak
+3  A: 

Yes, VS.NET Can add the using for you. When you type in a class name, hit CTRL + . and then enter (the first option is 99.99% the right one, so just hit enter). and you can have it add the using at the top of the file for the namespace of that class. I use it all the time.

This is easier than shift alt f10 + enter as its les keys and the . and enter are closer.

mattlant
Yeah, CTRL + . is shorter - Thanks for the tip. Sounds buggy too in VB.NET
controlbreak