C#: Same “using” in multiple files

后端 未结 2 872
挽巷
挽巷 2021-01-27 13:42

This is probably not the smartest question, but can you reuse the same using directives in multiple C# files? I have several \"typedefs\" (using foo = FooInc.

相关标签:
2条回答
  • 2021-01-27 13:50

    Unfortunately, you cannot do that with C# at this time - the directory must be present in any file you use... unless you make an automater for that.

    0 讨论(0)
  • 2021-01-27 14:08

    There is nothing out-of-the box that will do that, but you can have Visual Studio generate usings for you on the fly as you code by right-clicking a type name underlined with a red squiggle and selecting "Resolve > using ...".

    I find that if I do this, I don't often long for a feature that lets me auto copy/paste usings.

    0 讨论(0)
提交回复
热议问题