When must we use extern alias keyword in C#?

前端 未结 2 531
误落风尘
误落风尘 2020-11-30 12:25

When must we use extern alias keyword in C#?

2条回答
  •  旧巷少年郎
    2020-11-30 13:01

    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 :)

提交回复
热议问题