我们什么时候必须使用外部别名关键字在C#中? [英] When must we use extern alias keyword in C#?
本文介绍了我们什么时候必须使用外部别名关键字在C#中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们何时必须使用外部别名
关键字?
When must we use extern alias
keyword in C#?
推荐答案
基本上,你只真正需要它,当你想使用两种来自不同的程序集相同的完全限定域名(相同的命名空间,同一类型的名称)。声明每个装配不同的别名,这样,那么你可以通过该别名引用它们。
Basically you only really need it when you want to use two types with the same fully qualified name (same namespace, same type name) from different assemblies. You declare a different alias for each assembly, so you can then reference them via that alias.
不用说,你应该尽量避免陷入这种情况入手:)
Needless to say, you should try to avoid getting into that situation to start with :)
安森霍顿拥有它好的博客帖子。
这篇关于我们什么时候必须使用外部别名关键字在C#中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文