scope of types in an assembly

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Is it true that the CLR does not see any namespaces but only the assembly
while executing? can i have two types which have the same name in different
namespaces inside the same assembly and still have my program work? this
wldnt be possible if the runtime doesnt see namespaces?
thanks
shikher
 
It's true the runtime doesn't use namespaces per se, but the runtime does
only use a type's full name, which includes the namespace.

For instance, the following lines:

Type t = typeof(Int32);
Console.WriteLine(t.FullName);

Would spit out:
System.Int32

Thus the runtime would know the difference between Namespace1.MyClass and
Namespace2.MyClass - they have different full names.
 
Back
Top