This documentation is archived and is not being maintained.

TypeBuilder.GetGenericTypeDefinition Method

Returns a Type object that represents a generic type definition from which the current type can be obtained.

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

public override Type GetGenericTypeDefinition()

Return Value

Type: System.Type
A Type object representing a generic type definition from which the current type can be obtained.


The current type is not generic. That is, IsGenericType returns false.

If you call the GetGenericTypeDefinition method on a TypeBuilder object for which the IsGenericType property returns true, the GetGenericTypeDefinition property returns the current instance. A TypeBuilder that represents a generic type is always a generic type definition.

If you used the MakeGenericType method to construct a generic type from a TypeBuilder object that represents a generic type definition, using the Type.GetGenericTypeDefinition method on the constructed type gets back the TypeBuilder object that represents the generic type definition.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0