Add Using by shortcut in Visual Studio 2008

There's a nice little keyboard shortcut to resolve namespaces and add the to the using directives.

When trying to use a class that is outside of the using directives present the editor will display it as an error since it doesn't know of the namespace that the class we want to use.
There's a little dropdown arrow in the lower right where you can add the using statement. But there's an even faster way.

While standing on the class name, just press CTRL + . (that's holding down CTRL and then .) and you get up the options for which namespace to use. Often just enter is needed to add the preselected.

Related posts:

Comments

comments powered by Disqus