Returns a generic method constructed from the current generic method definition using the specified generic type arguments.
Assembly: mscorlib (in mscorlib.dll)
public override function MakeGenericMethod( ... typeArguments : Type ) : MethodInfo
When you are emitting dynamic code, you might need to emit a call to a method constructed from the generic method definition represented by a MethodBuilder, before the enclosing type has been completed. You can use the method to create a MethodInfo for such a constructed method, and use the MethodInfo in the emitted call.
The following code example creates a constructed method from an incomplete generic method definition in an incomplete type.
The example creates a transient assembly and module with a single type, adds a method M, and makes the method generic by adding a type parameter T using the DefineGenericParameters method. The type parameter is used as the type of the method's parameter, and also as its return type. The generic method definition is not given a body, and the enclosing type is not completed. The method is then used to make the constructed method M<String> (M(Of String) in Visual Basic). The example code has no output, because the subclass of MethodInfo returned by the method does not allow reflection over its parameters.
For another code example that uses , see DefineGenericParameters. is also used extensively when emitting code that uses generic types. See How to: Define a Generic Method with Reflection Emit.
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.