ModuleBuilder.GetTypes Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns all the classes defined within this module.

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

public override Type[] GetTypes()

Return Value

Type: System.Type[]

An array that contains the types defined within the module that is reflected by this instance.

Exception Condition
ReflectionTypeLoadException

One or more classes in a module could not be loaded.

SecurityException

The caller does not have the required permission.

ReflectionTypeLoadException is a special class load exception. The ReflectionTypeLoadException.Types property contains the array of classes that were defined in the module and loaded. This array can contain some null values. The ReflectionTypeLoadException.LoaderExceptions property is an array of exceptions that represent the exceptions that were thrown by the class loader. The holes in the class array line up with the exceptions.

For example, if the class initializers of one of the classes throws an exception while it is being loaded, a TargetInvocationException is stored in the corresponding element of the LoaderExceptions array.

System_CAPS_noteNote

Starting with the .NET Framework 2.0 Service Pack 1, this member no longer requires ReflectionPermission with the ReflectionPermissionFlag.ReflectionEmit flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the .NET Framework 3.5 or later.

.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Return to top
Show: