The NamespaceAlias aspect allows you to define a namespace (which may or may not already exist otherwise and contain types) that will automatically pull one or m ore additional namespaces, when imported/used.

Usage of the NamespaceAlias aspect in user code is uncommon and corner-case, the aspect is mostly provided for use by Elements RTL.


The namespace must be applied on assembly level, and expects two parameters: the name of the namespace to define, and an array of additional namespaces that the namespace will pull in automatically. In the example below, taken from Elements RTL, the RemObjects.Elements.RTL namespace is defined so that any place it is used/imported, the System.Linq namespace (of .NET) is also added to the scope.

[assembly:NamespaceAlias('RemObjects.Elements.RTL', ['System.Linq'])]
[assembly:NamespaceAlias("RemObjects.Elements.RTL", ["System.Linq"])]
@__assembly:NamespaceAlias("RemObjects.Elements.RTL", ["System.Linq"])
@__assembly:NamespaceAlias("RemObjects.Elements.RTL", ["System.Linq"])

See also