Auto Import Names

Is there a way in Visual Studio (hotkey) for automatically importing a type (or choosing between known namespaces), for example, Ctrl + O in Eclipse?

+67
import visual-studio keyboard-shortcuts hotkeys
09 Oct '08 at 11:51
source share
3 answers

When the red carriage appears at the end of your member, simply press Shift + Alt + F10 , then use the arrow keys to select the correct option:

Enter image description here

+51
Oct 09 '08 at 11:53
source share

Yes, Visual Studio can add using for you. When you enter a class name, press Ctrl + . and then Enter (the first option is 99.99% on the right, so just hit Enter ). And you can add it using at the top of the file for the namespace of this class. I use it all the time.

This is easier than Shift + Alt + F10 + Enter , as there are fewer and keys . and Enter is closer.

+75
09 Oct '08 at 11:57
source share

Check out JetBrain's excellent ReSharper product. He does it for you.

+6
09 Oct '08 at 11:52
source share



All Articles