mscorlib 2.0.0.0 4.0.0.0 System.Reflection.MethodInfo System.Runtime.InteropServices.ComVisible(true)

You can use the class to generate and execute a method at run time, without having to generate a dynamic assembly and a dynamic type to contain the method. The executable code created by the just-in-time (JIT) compiler is reclaimed when the object is reclaimed. Dynamic methods are the most efficient way to generate and execute small amounts of code.

A dynamic method can be anonymously hosted, or it can be logically associated with a module or with a type.

If the dynamic method is anonymously hosted, it is located in a system-provided assembly, and therefore is isolated from other code. By default, it does not have access to any non-public data. An anonymously hosted dynamic method can have restricted ability to skip the JIT compiler's visibility checks, if it has been granted with the flag. The trust level of the assembly whose non-public members are accessed by the dynamic method must be equal to, or a subset of, the trust level of the call stack that emitted the dynamic method. For more information about anonymously hosted dynamic methods, see Walkthrough: Emitting Code in Partial Trust Scenarios.

If the dynamic method is associated with a module that you specify, the dynamic method is effectively global to that module. It can access all types in the module and all internal (Friend in Visual Basic) members of the types. You can associate a dynamic method with any module, regardless of whether you created the module, provided that a demand for with the flag can be satisfied by the call stack that includes your code. If the flag is included in the grant, the dynamic method can skip the JIT compiler's visibility checks and access the private data of all types declared in the module or in any other module in any assembly.

When you specify the module with which a dynamic method is associated, that module must not be in the system-provided assembly that is used for anonymous hosting.

If the dynamic method is associated with a type that you specify, it has access to all members of the type, regardless of access level. In addition, JIT visibility checks can be skipped. This gives the dynamic method access to the private data of other types declared in the same module or in any other module in any assembly. You can associate a dynamic method with any type, but your code must be granted with both the and flags.

The following table shows which types and members are accessible to an anonymously hosted dynamic method, with and without JIT visibility checks, depending on whether with the flag is granted.

Without

With

Without skipping JIT visibility checks

Public members of public types in any assembly.

Public members of public types in any assembly.

Skipping JIT visibility checks, with restrictions

Public members of public types in any assembly.

All members of all types, only in assemblies whose trust levels are equal to or less than the trust level of the assembly that emitted the dynamic method.

Prior to the net_v20sp1_long, emitting code required with the flag. This permission is included by default in the FullTrust and LocalIntranet named permission sets, but not in the Internet permission set. Therefore, in earlier versions of the dnprdnshort a library can be used with Internet permissions only if it has the attribute and also executes an for . Such libraries require careful security review because coding errors could result in security holes. The net_v20SP1_short allows code to be emitted in partial trust scenarios without issuing any security demands, because generating code is not inherently a privileged operation. That is, the generated code has no more permissions than the assembly that emits it. This allows libraries that emit code to be security transparent and removes the need to assert , which simplifies the task of writing a secure library. To use this feature, your application should target the net_v35_long or later.

The following table shows which types and members are accessible to a dynamic method that is associated with a module or with a type in a module.

Associated with module

Associated with type

Without skipping JIT visibility checks

Public and internal members of public, internal, and private types in the module.

Public members of public types in any assembly.

All members of the associated type. Public and internal members of all the other types in the module.

Public members of public types in any assembly.

Skipping JIT visibility checks

All members of all types in any assembly.

All members of all types in any assembly.

A dynamic method that is associated with a module has the permissions of that module. A dynamic method that is associated with a type has the permissions of the module containing that type.

Dynamic methods and their parameters do not have to be named, but you can specify names to assist in debugging. Custom attributes are not supported on dynamic methods or their parameters.

Although dynamic methods are static methods (Shared methods in Visual Basic), the relaxed rules for delegate binding introduced in the dnprdnlong allow a dynamic method to be bound to an object, so that it acts like an instance method when called using that delegate instance. An example that demonstrates this is provided for the method overload.

In the dnprdnlong, dynamic methods do not support symbol information, that is, local variable names and line-number mapping. This limitation might be removed in a future version. You can use during development to simplify debugging the generated Microsoft intermediate language (MSIL), and then switch to dynamic methods during final deployment, because the calls are the same in both cases.

## Verification

The following list summarizes the conditions under which dynamic methods can contain unverifiable code. (For example, a dynamic method is unverifiable if its property is set to false.)

A dynamic method that is associated with a security-critical assembly is also security-critical, and can skip verification. For example, an assembly without security attributes that is run as a desktop application is treated as security-critical by the runtime. If you associate a dynamic method with the assembly, the dynamic method can contain unverifiable code.

If a dynamic method that contains unverifiable code is associated with an assembly that has level 1 transparency, the just-in-time (JIT) compiler injects a security demand. The demand succeeds only if the dynamic method is executed by fully trusted code. See Security-Transparent Code, Level 1.

If a dynamic method that contains unverifiable code is associated with an assembly that has level 2 transparency (such as mscorlib.dll), it throws an exception (injected by the JIT compiler) instead of making a security demand. See Security-Transparent Code, Level 2.

An anonymously hosted dynamic method that contains unverifiable code always throws an exception. It can never skip verification, even if it is created and executed by fully trusted code.

The exception that is thrown for unverifiable code varies depending on the way the dynamic method is invoked. If you invoke a dynamic method by using a delegate returned from the method, a is thrown. If you invoke the dynamic method by using the method, a is thrown with an inner .

Defines and represents a dynamic method that can be compiled, executed, and discarded. Discarded methods are available for garbage collection.

- Constructor
  2.0.0.0
  4.0.0.0

  The dynamic method that is created by this constructor is associated with an anonymous assembly instead of an existing type or module. The anonymous assembly exists only to provide a sandbox environment for dynamic methods, that is, to isolate them from other code. This environment makes it safe for the dynamic method to be emitted and executed by partially trusted code.

  This constructor specifies that just-in-time (JIT) visibility checks will be enforced for the Microsoft intermediate language (MSIL) of the dynamic method. That is, the code in the dynamic method has access to public methods of public classes. Exceptions are thrown if the method tries to access types or members that are private, protected, or internal (Friend in Visual Basic). To create a dynamic method that has restricted ability to skip JIT visibility checks, use the constructor.

  When an anonymously hosted dynamic method is constructed, the call stack of the emitting assembly is included. When the method is invoked, the permissions of the emitting assembly are used instead of the permissions of the actual caller. Thus, the dynamic method cannot execute at a higher level of privilege than that of the assembly that emitted it, even if it is passed to and executed by an assembly that has a higher trust level.

  This constructor specifies the method attributes and , and the calling convention .

  This constructor was introduced in the net_v35_long or later.

  Initializes an anonymously hosted dynamic method, specifying the method name, return type, and parameter types.

  The name of the dynamic method. This can be a zero-length string, but it cannot be null.
  A object that specifies the return type of the dynamic method, or null if the method has no return type.
  An array of objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters.
- Constructor
  2.0.0.0
  4.0.0.0

  The dynamic method that is created by this constructor is associated with an anonymous assembly instead of an existing type or module. The anonymous assembly exists only to provide a sandbox environment for dynamic methods, that is, to isolate them from other code. This environment makes it safe for the dynamic method to be emitted and executed by partially trusted code.

  Anonymously hosted dynamic methods do not have automatic access to any types or members that are private, protected, or internal (Friend in Visual Basic). This is different from dynamic methods that are associated with an existing type or module, which have access to hidden members in their associated scope.

  Specify true for if your dynamic method has to access types or members that are private, protected, or internal. This gives the dynamic method restricted access to these members. That is, the members can be accessed only if the following conditions are met:

  The target members belong to an assembly that has a level of trust equal to or lower than the call stack that emits the dynamic method.

  The call stack that emits the dynamic method is granted with the flag. This is always true when the code is executed with full trust. For partially trusted code, it is true only if the host explicitly grants the permission.

  If the permission has not been granted, a security exception is thrown when is called or when the dynamic method is invoked, not when this constructor is called. No special permissions are required to emit the dynamic method.

  For example, a dynamic method that is created with set to true can access a private member of any assembly on the call stack if the call stack has been granted restricted member access. If the dynamic method is created with partially trusted code on the call stack, it cannot access a private member of a type in a dnprdnshort assembly, because such assemblies are fully trusted.

  If is false, JIT visibility checks are enforced. The code in the dynamic method has access to public methods of public classes, and exceptions are thrown if it tries to access types or members that are private, protected, or internal.

  When an anonymously hosted dynamic method is constructed, the call stack of the emitting assembly is included. When the method is invoked, the permissions of the emitting call stack are used instead of the permissions of the actual caller. Thus, the dynamic method cannot execute at a higher level of privilege than that of the assembly that emitted it, even if it is passed to and executed by an assembly that has a higher trust level.

  This constructor specifies the method attributes and , and the calling convention .

  This constructor was introduced in the net_v35_long or later.

  Initializes an anonymously hosted dynamic method, specifying the method name, return type, parameter types, and whether just-in-time (JIT) visibility checks should be skipped for types and members accessed by the Microsoft intermediate language (MSIL) of the dynamic method.

  The name of the dynamic method. This can be a zero-length string, but it cannot be null.
  A object that specifies the return type of the dynamic method, or null if the method has no return type.
  An array of objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters.
  true to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method, with this restriction: the trust level of the assemblies that contain those types and members must be equal to or less than the trust level of the call stack that emits the dynamic method; otherwise, false.
- Constructor
  2.0.0.0
  4.0.0.0

  This constructor specifies method attributes and , calling convention , and does not skip just-in-time (JIT) visibility checks.

  The dynamic method created with this constructor has access to public and internal (Friend in Visual Basic) members of all the types contained in module .

  For backward compatibility, this constructor demands with the flag if the following conditions are both true: is a module other than the calling module, and the demand for with the flag has failed. If the demand for succeeds, the operation is allowed.

  Starting with the net_v20sp1_long, this member no longer requires with the flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the net_v35_long or later.

  Creates a dynamic method that is global to a module, specifying the method name, return type, parameter types, and module.

  The name of the dynamic method. This can be a zero-length string, but it cannot be null.
  A object that specifies the return type of the dynamic method, or null if the method has no return type.
  An array of objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters.
  A representing the module with which the dynamic method is to be logically associated.
- Constructor
  2.0.0.0
  4.0.0.0

  The dynamic method created with this constructor has access to all members of the type , and to public and internal (Friend in Visual Basic) members of all the other types in the module that contains .

  This constructor specifies method attributes and , calling convention , and does not skip just-in-time (JIT) visibility checks.

  For backward compatibility, this constructor demands with the flag if the following conditions are both true: is in a module other than the calling module, and the demand for with the flag has failed. If the demand for succeeds, the operation is allowed.

  Starting with the net_v20sp1_long, this member no longer requires with the flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the net_v35_long or later.

  Creates a dynamic method, specifying the method name, return type, parameter types, and the type with which the dynamic method is logically associated.

  The name of the dynamic method. This can be a zero-length string, but it cannot be null.
  A object that specifies the return type of the dynamic method, or null if the method has no return type.
  An array of objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters.
  A with which the dynamic method is logically associated. The dynamic method has access to all members of the type.
- Constructor
  2.0.0.0
  4.0.0.0

  This constructor specifies method attributes and , and calling convention .

  The dynamic method created with this constructor has access to public and internal (Friend in Visual Basic) members of all the types in contained module . Skipping the JIT compiler's visibility checks allows the dynamic method to access private and protected members of all other types as well. This is useful, for example, when writing code to serialize objects.

  For backward compatibility, this constructor demands with the flag if the following conditions are both true: is a module other than the calling module, and the demand for with the flag has failed. If the demand for succeeds, the operation is allowed.

  Starting with the net_v20sp1_long, this member no longer requires with the flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the net_v35_long or later.

  Creates a dynamic method that is global to a module, specifying the method name, return type, parameter types, module, and whether just-in-time (JIT) visibility checks should be skipped for types and members accessed by the Microsoft intermediate language (MSIL) of the dynamic method.

  The name of the dynamic method. This can be a zero-length string, but it cannot be null.
  A object that specifies the return type of the dynamic method, or null if the method has no return type.
  An array of objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters.
  A representing the module with which the dynamic method is to be logically associated.
  true to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method.
- Constructor
  2.0.0.0
  4.0.0.0

  The dynamic method created with this constructor has access to all members of the type , and to public and internal (Friend in Visual Basic) members of all the other types in the module that contains . Skipping the JIT compiler's visibility checks allows the dynamic method to access private and protected members of all other types as well. This is useful, for example, when writing code to serialize objects.

  This constructor specifies method attributes and , and calling convention .

  For backward compatibility, this constructor demands with the flag if the following conditions are both true: is in a module other than the calling module, and the demand for with the flag has failed. If the demand for succeeds, the operation is allowed.

  Starting with the net_v20sp1_long, this member no longer requires with the flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the net_v35_long or later.

  Creates a dynamic method, specifying the method name, return type, parameter types, the type with which the dynamic method is logically associated, and whether just-in-time (JIT) visibility checks should be skipped for types and members accessed by the Microsoft intermediate language (MSIL) of the dynamic method.

  The name of the dynamic method. This can be a zero-length string, but it cannot be null.
  A object that specifies the return type of the dynamic method, or null if the method has no return type.
  An array of objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters.
  A with which the dynamic method is logically associated. The dynamic method has access to all members of the type.
  true to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method; otherwise, false.
- Constructor
  2.0.0.0
  4.0.0.0

  The dynamic method created with this constructor has access to public and internal (Friend in Visual Basic) members of all the public and internal types contained in module .

  Skipping the JIT compiler's visibility checks allows the dynamic method to access private and protected members of all other types in the module and in all other assemblies as well. This is useful, for example, when writing code to serialize objects.

  For backward compatibility, this constructor demands with the flag if the following conditions are both true: is a module other than the calling module, and the demand for with the flag has failed. If the demand for succeeds, the operation is allowed.

  Starting with the net_v20sp1_long, this member no longer requires with the flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the net_v35_long or later.

  Creates a dynamic method that is global to a module, specifying the method name, attributes, calling convention, return type, parameter types, module, and whether just-in-time (JIT) visibility checks should be skipped for types and members accessed by the Microsoft intermediate language (MSIL) of the dynamic method.

  The name of the dynamic method. This can be a zero-length string, but it cannot be null.
  A bitwise combination of values that specifies the attributes of the dynamic method. The only combination allowed is and .
  The calling convention for the dynamic method. Must be .
  A object that specifies the return type of the dynamic method, or null if the method has no return type.
  An array of objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters.
  A representing the module with which the dynamic method is to be logically associated.
  true to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method; otherwise, false.
- Constructor
  2.0.0.0
  4.0.0.0

  The dynamic method is global to the module that contains the type . It has access to all members of the type .

  The dynamic method created with this constructor has access to all members of the type , and to public and internal (Friend in Visual Basic) members of all the types contained in the module that contains . Skipping the JIT compiler's visibility checks allows the dynamic method to access private and protected members of all other types as well. This is useful, for example, when writing code to serialize objects.

  For backward compatibility, this constructor demands with the flag if the following conditions are both true: is in a module other than the calling module, and the demand for with the flag has failed. If the demand for succeeds, the operation is allowed.

  Starting with the net_v20sp1_long, this member no longer requires with the flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the net_v35_long or later.

  Creates a dynamic method, specifying the method name, attributes, calling convention, return type, parameter types, the type with which the dynamic method is logically associated, and whether just-in-time (JIT) visibility checks should be skipped for types and members accessed by the Microsoft intermediate language (MSIL) of the dynamic method.

  The name of the dynamic method. This can be a zero-length string, but it cannot be null.
  A bitwise combination of values that specifies the attributes of the dynamic method. The only combination allowed is and .
  The calling convention for the dynamic method. Must be .
  A object that specifies the return type of the dynamic method, or null if the method has no return type.
  An array of objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters.
  A with which the dynamic method is logically associated. The dynamic method has access to all members of the type.
  true to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method; otherwise, false.
- Property
  2.0.0.0
  4.0.0.0
  System.Reflection.MethodAttributes To be added.

  Currently, the method attributes for a dynamic method are always and .

  Gets the attributes specified when the dynamic method was created.

- Property
  2.0.0.0
  4.0.0.0
  System.Reflection.CallingConventions To be added.

  Currently, the calling convention for a dynamic method is always .

  Gets the calling convention specified when the dynamic method was created.

- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Delegate ``

  Calling the method or the method completes the dynamic method. Any further attempt to alter the dynamic method, such as modifying parameter definitions or emitting more Microsoft intermediate language (MSIL), is ignored; no exception is thrown.

  To create a method body for a dynamic method when you have your own MSIL generator, call the method to obtain a object. If you do not have your own MSIL generator, call the method to obtain an object that can be used to generate the method body.

  Completes the dynamic method and creates a delegate that can be used to execute it.

  A delegate of the specified type, which can be used to execute the dynamic method.

  A delegate type whose signature matches that of the dynamic method.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Delegate `` ``

  This method overload creates a delegate bound to a particular object. Such a delegate is said to be closed over its first argument. Although the method is static, it acts as if it were an instance method; the instance is .

  This method overload requires to be of the same type as the first parameter of the dynamic method, or to be assignable to that type (for example, a derived class). The signature of has all the parameters of the dynamic method except the first. For example, if the dynamic method has the parameters , , and , then has the parameters and ; is of type .

  Calling the method or the method completes the dynamic method. Any further attempt to alter the dynamic method, such as modifying parameter definitions or emitting more Microsoft intermediate language (MSIL), is ignored; no exception is thrown.

  To create a method body for a dynamic method when you have your own MSIL generator, call the method to obtain a object. If you do not have your own MSIL generator, call the method to obtain an object that can be used to generate the method body.

  Completes the dynamic method and creates a delegate that can be used to execute it, specifying the delegate type and an object the delegate is bound to.

  A delegate of the specified type, which can be used to execute the dynamic method with the specified target object.

  A delegate type whose signature matches that of the dynamic method, minus the first parameter. An object the delegate is bound to. Must be of the same type as the first parameter of the dynamic method.
- Property
  2.0.0.0
  4.0.0.0
  System.Type To be added.

  This property always returns null for dynamic methods. Even when a dynamic method is logically associated with a type, it is not declared by the type.

  Gets the type that declares the method, which is always null for dynamic methods.

- Method
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.ParameterBuilder `` `` ``

  If is 0, the method refers to the return value. Setting parameter information has no effect on the return value.

  If the dynamic method has already been completed, by calling the or method, the method has no effect. No exception is thrown.

  Defines a parameter of the dynamic method.

  Always returns null.

  The position of the parameter in the parameter list. Parameters are indexed beginning with the number 1 for the first parameter. A bitwise combination of values that specifies the attributes of the parameter. The name of the parameter. The name can be a zero-length string.
- Method
  System.Void To be added. To be added. 2.0.0.0
- Method
  2.0.0.0
  4.0.0.0
  System.Reflection.MethodInfo

  This method always returns the current DynamicMethod object.

  Returns the base implementation for the method.

  The base implementation of the method.

- Method
  2.0.0.0
  4.0.0.0
  System.Object[] ``

  For dynamic methods, specifying true for has no effect, because the method is not declared in a type.

  Custom attributes are not currently supported on dynamic methods. The only attribute returned is ; you can get the method implementation flags more easily using the method.

  Returns all the custom attributes defined for the method.

  An array of objects representing all the custom attributes of the method.

  true to search the method's inheritance chain to find the custom attributes; false to check only the current method.
- Method
  2.0.0.0
  4.0.0.0
  System.Object[] `` ``

  For dynamic methods, specifying true for has no effect, because the method is not declared in a type.

  Custom attributes are not currently supported on dynamic methods. The only attribute returned is ; you can get the method implementation flags more easily using the method.

  Returns the custom attributes of the specified type that have been applied to the method.

  An array of objects representing the attributes of the method that are of type or derive from type .

  A representing the type of custom attribute to return. true to search the method's inheritance chain to find the custom attributes; false to check only the current method.
- Method
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.DynamicILInfo

  The class is provided to support unmanaged code generation. For more information, see The Unmanaged Reflection API.

  Returns a object that can be used to generate a method body from metadata tokens, scopes, and Microsoft intermediate language (MSIL) streams.

  A object that can be used to generate a method body from metadata tokens, scopes, and MSIL streams.

- Method
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.ILGenerator

  After a dynamic method has been completed, by calling the or method, any further attempt to add MSIL is ignored. No exception is thrown.

  There are restrictions on unverifiable code in dynamic methods, even in some full-trust scenarios. See the "Verification" section in Remarks for .

  Returns a Microsoft intermediate language (MSIL) generator for the method with a default MSIL stream size of 64 bytes.

  An object for the method.

- Method
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.ILGenerator ``

  After a dynamic method has been completed, by calling the or method, any further attempt to add MSIL is ignored. No exception is thrown.

  There are restrictions on unverifiable code in dynamic methods, even in some full-trust scenarios. See the "Verification" section in Remarks for .

  Returns a Microsoft intermediate language (MSIL) generator for the method with the specified MSIL stream size.

  An object for the method, with the specified MSIL stream size.

  The size of the MSIL stream, in bytes.
- Method
  2.0.0.0
  4.0.0.0
  System.Reflection.MethodImplAttributes

  Currently, method implementation attributes for dynamic methods are always and .

  Returns the implementation flags for the method.

  A bitwise combination of values representing the implementation flags for the method.

- Method
  2.0.0.0
  4.0.0.0
  System.Reflection.ParameterInfo[]

  The objects returned by this method are for information only. Use the method to set or change the characteristics of the parameters.

  Returns the parameters of the dynamic method.

  An array of objects that represent the parameters of the dynamic method.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  If this property is set to true, the emitted Microsoft intermediate language (MSIL) includes initialization of local variables. If it is set to false, local variables are not initialized and the generated code is unverifiable.

  Gets or sets a value indicating whether the local variables in the method are zero-initialized.

- Method
  2.0.0.0
  4.0.0.0
  System.Object `` `` `` `` ``

  In addition to the listed exceptions, the calling code should be prepared to catch any exceptions thrown by the dynamic method.

  Executing a dynamic method with a delegate created by the method is more efficient than executing it with the method.

  Calling the method or the method completes the dynamic method. Any further attempt to alter the dynamic method, such as modifying parameter definitions or emitting more Microsoft intermediate language (MSIL), is ignored; no exception is thrown.

  All dynamic methods are static, so the parameter is always ignored. To treat a dynamic method as if it were an instance method, use the overload that takes an object instance.

  If the dynamic method has no parameters, the value of should be null. Otherwise the number, type, and order of elements in the parameters array should be identical to the number, type, and order of parameters of the dynamic method.

  This method overload is called by the method overload inherited from the class, so the preceding remarks apply to both overloads.

  This method does not demand permissions directly, but invoking the dynamic method can result in security demands, depending on the method. For example, no demands are made for anonymously hosted dynamic methods that are created with the parameter set to false. On the other hand, if you create a method with set to true so it can access a hidden member of a target assembly, the method will cause a demand for the permissions of the target assembly plus with the flag.

  Prior to the net_v20sp1_long, this method required with the flag.

  Invokes the dynamic method using the specified parameters, under the constraints of the specified binder, with the specified culture information.

  A containing the return value of the invoked method.

  This parameter is ignored for dynamic methods, because they are static. Specify null. A bitwise combination of values. A object that enables the binding, coercion of argument types, invocation of members, and retrieval of objects through reflection. If is null, the default binder is used. For more details, see . An argument list. This is an array of arguments with the same number, order, and type as the parameters of the method to be invoked. If there are no parameters this parameter should be null. An instance of used to govern the coercion of types. If this is null, the for the current thread is used. For example, this information is needed to correctly convert a that represents 1000 to a value, because 1000 is represented differently by different cultures.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  For dynamic methods, specifying true for has no effect. Dynamic methods have no inheritance chain.

  Custom attributes are not currently supported on dynamic methods.

  Indicates whether the specified custom attribute type is defined.

  true if the specified custom attribute type is defined; otherwise, false.

  A representing the type of custom attribute to search for. true to search the method's inheritance chain to find the custom attributes; false to check only the current method.
- Property
  2.0.0.0
  4.0.0.0
  System.RuntimeMethodHandle To be added. To be added.

  Not supported for dynamic methods.

- Property
  2.0.0.0
  4.0.0.0
  System.Reflection.Module To be added.

  If a module was specified when the dynamic method was created, this property returns that module. If a type was specified as the owner when the dynamic method was created, this property returns the module which contains that type.

  Gets the module with which the dynamic method is logically associated.

- Property
  2.0.0.0
  4.0.0.0
  System.String To be added.

  It is not necessary to name dynamic methods.

  Gets the name of the dynamic method.

- Property
  2.0.0.0
  4.0.0.0
  System.Type To be added.

  This property always returns null for dynamic methods.

  Gets the class that was used in reflection to obtain the method.

- Property
  2.0.0.0
  4.0.0.0
  System.Reflection.ParameterInfo To be added.

  This property always returns null for dynamic methods.

  Gets the return parameter of the dynamic method.

- Property
  2.0.0.0
  4.0.0.0
  System.Type To be added.

  If null was specified for the return type when the dynamic method was created, this property returns .

  Gets the type of return value for the dynamic method.

- Property
  2.0.0.0
  4.0.0.0
  System.Reflection.ICustomAttributeProvider To be added.

  Custom attributes are not supported on the return type of a dynamic method, so the array of custom attributes returned by the method is always empty.

  Gets the custom attributes of the return type for the dynamic method.

- Method
  2.0.0.0
  4.0.0.0
  System.String

  The signature includes only types and the method name, if any. Parameter names are not included.

  Returns the signature of the method, represented as a string.

  A string representing the method signature.