ECMA-334 C# Language Specification

16.3: Using directives

Using-directives facilitate the use of namespaces and types defined in other namespaces. Using-directives impact the name resolution process of namespace-or-type-names (10.8) and simple-names (14.5.2), but unlike declarations, using-directives do not contribute new members to the underlying declaration spaces of the compilation units or namespaces within which they are used.

using-directive
using-directive
using-directives using-directive
using-directive
using-alias-directive
using-namespace-directive

A using-alias-directive (16.3.1) introduces an alias for a namespace or type.

A using-namespace-directive (16.3.2) imports the type members of a namespace.

The scope of a using-directive extends over the namespace-member-declarations of its immediately containing compilation unit or namespace body. The scope of a using-directive specifically does not include its peer using-directives. Thus, peer using-directives do not affect each other, and the order in which they are written is insignificant.

In This Section: