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

Refresh

December 2018

Views

32 time

1

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?

2 answers

2

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

1

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.