On MSDN I can read what it does, but I would like to know what it does technically (tells compiler where to look for types..)? I mean using as a directive.
C# Using Directive – What Does It Do Exactly?
c++namespacesusing-directives
c++namespacesusing-directives
On MSDN I can read what it does, but I would like to know what it does technically (tells compiler where to look for types..)? I mean using as a directive.
Best Answer
The primary function of the
using
directive is to make types within a namespace available without qualification to the user code. It considers the set of namespaces and types which are defined in referenced assemblies and the project being compiled.Take for example the following definition in MyTypes.Dll
Now consider referencing
MyTypes.dll
from another project with a different namespace. Without a using directive to createClass1
i need to qualify the nameThe
using
directive lets me remove this qualification