ECMA-334 C# Language Specification

10.8: Namespace and type names

Several contexts in a C# program require a namespace-name or a type-name to be specified. Either form of name is written as one or more identifiers separated by "." tokens.

namespace-name
namespace-or-type-name
type-name
namespace-or-type-name
namespace-or-type-name
identifier
namespace-or-type-name . identifier

A type-name is a namespace-or-type-name that refers to a type. Following resolution as described below, the namespace-or-type-name of a type-name must refer to a type, or otherwise a compile-time error occurs.

A namespace-name is a namespace-or-type-name that refers to a namespace. Following resolution as described below, the namespace-or-type-name of a namespace-name must refer to a namespace, or otherwise a compile-time error occurs.

The meaning of a namespace-or-type-name is determined as follows:

In This Section: