Automatic namespaces import

你。 提交于 2019-11-29 23:26:32
Larry

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:

mattlant

Yes, Visual Studio 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 it's fewer keys and the . and Enter are closer.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!