I'm playing around with namespaces and faced a problem I can't really understand.
My namespace structure in a given class library is as follows:
Namespace History
Namespace History.Antiquity
Namespace History.Antiquity.East
Namespace History.Antiquity.West
When inside the source file that declares the namespace History, I can't use any of the types defined under History.Antiquity.East or History.Antiquity.West without fully qualifying them, or without qualifying them starting with "Antiquity".
Example Code:
The following for instance, gives me a compile-time error (assuming the type "Persia" is defined in History.Antiquity.East):
using History.Antiquity;
namespace History
{
public class foo
{
public foo()
{
East.Persia.Conquer(); // error!
}
}
}
I need to either fully qualify Persia, or qualify it starting from Antiquity. Alternatively, I can introduce an alias:
using East = History.Antiquity.East;
Actual question:
What I can't seem to understand is why is there a problem with this namespace structure. How can it be that .Net finds it conflicting?