Can I refer to two equally named namespaces?

The title should say it all ...

EDIT : Apparently, the headline didn't say everything, but John Skeet was able to figure out what I meant anyway!

+3
source share
3 answers

Assuming you want to refer to types in the same namespace (or even the same fully qualified type name) provided by two different assemblies, you can do this with C # 2 and using extern aliases .

Ideally, you should try to avoid getting into this situation, but you can do it if you really need to.

Anson Horton Visual Studio.

+6

, ....

"" , , , , .

+2

That's right. There are serious reasons for having one namespace in different assemblies - for example, if some part is written in C # and the other in C ++ / CLI.

You never refer to a namespace, sorry. You are referencing the assembly.

+1
source

Source: https://habr.com/ru/post/1746354/


All Articles