The ExportedType table holds a row for each type:
-
Defined within other modules of this Assembly; that is exported out of this Assembly. In essence, it stores TypeDef row numbers of all types that are marked public in other modules that this Assembly comprises.
The actual target row in a TypeDef table is given by the combination of TypeDefId (in effect, row number) and Implementation (in effect, the module that holds the target TypeDef table). Note that this is the only occurrence in metadata of foreign tokens; that is, token values that have a meaning in another module. (A regular token value is an index into a table in the current module); OR
-
Originally defined in this Assembly but now moved to another Assembly. Flags must have
IsTypeForwarder
set and Implementation is an AssemblyRef indicating the Assembly the type may now be found in.
The full name of the type need not be stored directly. Instead, it can be split into two parts at any included "." (although typically this is done at the last "." in the full name). The part preceding the "." is stored as the TypeNamespace and that following the "." is stored as the TypeName. If there is no "." in the full name, then the TypeNamespace shall be the index of the empty string.
The ExportedType table has the following columns:
-
Flags (a 4-byte bitmask of type TypeAttributes, §II.23.1.15)
-
TypeDefId (a 4-byte index into a TypeDef table of another module in this Assembly). This column is used as a hint only. If the entry in the target TypeDef table matches the TypeName and TypeNamespace entries in this table, resolution has succeeded. But if there is a mismatch, the CLI shall fall back to a search of the target TypeDef table. Ignored and should be zero if Flags has
IsTypeForwarder
set. -
TypeName (an index into the String heap)
-
TypeNamespace (an index into the String heap)
-
Implementation. This is an index (more precisely, an Implementation (§II.24.2.6) coded index) into either of the following tables:
-
File table, where that entry says which module in the current assembly holds the TypeDef
-
ExportedType table, where that entry is the enclosing Type of the current nested Type
-
AssemblyRef table, where that entry says in which assembly the type may now be found (Flags must have the
IsTypeForwarder
flag set).
-
The rows in the ExportedType table are the result of the .class extern directive (§II.6.7).
This contains informative text only.
The term "FullName" refers to the string created as follows: if the TypeNamespace is null, then use the TypeName, otherwise use the concatenation of TypeNamespace, ".", and TypeName.
-
The ExportedType table can contain zero or more rows
-
There shall be no entries in the ExportedType table for Types that are defined in the current module—just for Types defined in other modules within the Assembly [ERROR]
-
Flags shall have only those values set that are specified [ERROR]
-
If Implementation indexes the File table, then Flags.
VisibilityMask
shall bePublic
(§II.23.1.15) [ERROR] -
If Implementation indexes the ExportedType table, then Flags.
VisibilityMask
shall beNestedPublic
(§II.23.1.15) [ERROR] -
If non-null, TypeDefId should index a valid row in a TypeDef table in a module somewhere within this Assembly (but not this module), and the row so indexed should have its Flags.
Public
= 1 (§II.23.1.15) [WARNING] -
TypeName shall index a non-empty string in the String heap [ERROR]
-
TypeNamespace can be null, or non-null
-
If TypeNamespace is non-null, then it shall index a non-empty string in the String heap [ERROR]
-
FullName shall be a valid CLS identifier [CLS]
-
If this is a nested Type, then TypeNamespace should be null, and TypeName should represent the unmangled, simple name of the nested Type [ERROR]
-
Implementation shall be a valid index into either of the following: [ERROR]
-
the File table; that file shall hold a definition of the target Type in its TypeDef table
-
a different row in the current ExportedType table—this identifies the enclosing Type of the current, nested Type
-
-
FullName shall match exactly the corresponding FullName for the row in the TypeDef table indexed by TypeDefId [ERROR]
-
Ignoring nested Types, there shall be no duplicate rows, based upon FullName [ERROR]
-
For nested Types, there shall be no duplicate rows, based upon TypeName and enclosing Type [ERROR]
-
The complete list of Types exported from the current Assembly is given as the catenation of the ExportedType table with all public Types in the current TypeDef table, where "public" means a Flags.
VisibilityMask
of eitherPublic
orNestedPublic
. There shall be no duplicate rows, in this concatenated table, based upon FullName (add Enclosing Type into the duplicates check if this is a nested Type) [ERROR]
End informative text.