Share via


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)

Syntax

'Declaration
Public Overridable Function GetTypes As Type()
public virtual Type[] GetTypes()
public:
virtual array<Type^>^ GetTypes()
abstract GetTypes : unit -> Type[] 
override GetTypes : unit -> Type[] 
public function GetTypes() : Type[]

Return Value

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

Remarks

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.

.NET Framework Security

See Also

Reference

Assembly Class

System.Reflection Namespace