GetTypes Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets the types defined in this assembly.

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

abstract GetTypes : unit -> Type[] 
override GetTypes : unit -> Type[] 

Return Value

Type: array<System..::..Type>[]()[][]
An array that contains all the types that are defined in this assembly.

The returned array includes nested types.

If the GetTypes method is called on an assembly and a type in that assembly is dependent on a type in an assembly that has not been loaded (for example, if it derives from a type in the second assembly), a ReflectionTypeLoadException is thrown. For example, this can happen if the first assembly was loaded with the ReflectionOnlyLoad or ReflectionOnlyLoadFrom methods, and the second assembly was not loaded. It can also happen with assemblies loaded using the Load and LoadFile methods if the second assembly cannot be located when the GetTypes method is called.

Show: