Kumaravel Rajan
Kumaravel Rajan

Reputation: 131

Is Reflection a nested namespace inside System namespace in C#?

I was wondering why we need to specify using System.Reflection separately from using System while making use of methods in class Type. Is Reflection a nested namespace, inside System namespace?

Upvotes: 1

Views: 97

Answers (2)

Hameed Syed
Hameed Syed

Reputation: 4275

Using System namespace does not include all child namespaces.

Here, System.Reflection is a child namespace of System.So you have to import it explicitly by using directive.

Note:Same principle applies to all namespace in c# for example System and System.IO and many more.

Upvotes: 1

Wyck
Wyck

Reputation: 11740

Yes, System.Reflection is a namespace inside the System namespace. https://msdn.microsoft.com/en-us/library/mt481557(v=vs.110).aspx

Upvotes: 2

Related Questions