Is it possible to use an alias defined in one file throughout an assembly?
For eg. in Foo.cs I have
using IO = System.IO;
namespace Foo
{}
How can I use the alias "IO" in FooBar.cs
namespace Foo.Bar
{}
According to MSDN
The scope of a using directive is limited to the file in which it appears.
So the answer is No. You cannot define an alias in one file and use it throughout assembly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With