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 ()
public Type GetGenericTypeDefinition ()
public override function GetGenericTypeDefinition () : Type
Not applicable.

Return Value

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

Exception typeCondition


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 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0