Often when including namespaces or assemblies into my code, I often run into strange cases where a namespace is inherited from another, yet classes from the parent namespace are not available. For example, when using List<>
or Dictionary<>
, I use the System.Collections.Generic
namespace. However, if I also want to use an IEnumerator
, I also have to include the System.Collections
namespace. Shouldn't System.Collections
already be referenced by any member of System.Collections.Generic
, as it is a child? Both namespaces also share the same assembly, mscorlib.dll.
Why is the parent namespace not included when the child is?