John
John

Reputation: 2363

C#: Same "using" in multiple files

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.FooProd.SomeClass;) and would love not to have to Ctrl+C, Ctrl+V them in each file.

Upvotes: 0

Views: 134

Answers (2)

foxy
foxy

Reputation: 7672

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.

Upvotes: 1

devuxer
devuxer

Reputation: 42374

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.

Upvotes: 2

Related Questions