System.Reflection.Emit.Lightweight Provides support for alternative ways to generate the Microsoft intermediate language (MSIL) and metadata for a dynamic method, including methods for creating tokens and for inserting the code, exception handling, and local variable signature blobs. Gets the dynamic method whose body is generated by the current instance. A object representing the dynamic method for which the current object is generating code. Gets a token, valid in the scope of the current , representing the signature for the associated dynamic method. An array that contains the signature. A token that can be embedded in the metadata and the MSIL stream for the associated dynamic method. Gets a token, valid in the scope of the current , representing a dynamic method to be called from the associated method. The dynamic method to call. A token that can be embedded in the MSIL stream for the associated dynamic method, as the target of an MSIL instruction. Gets a token, valid in the scope of the current , representing a field to be accessed from the associated dynamic method. The field to be accessed. A token that can be used as the operand of an MSIL instruction that accesses fields, in the scope of the current object. Gets a token, valid in the scope of the current , representing a field to be accessed from the associated dynamic method; the field is on the specified generic type. The field to be accessed. The generic type the field belongs to. A token that can be used as the operand of an MSIL instruction that accesses fields in the scope of the current object. Gets a token, valid in the scope of the current , representing a method to be accessed from the associated dynamic method. The method to be accessed. A token that can be used as the operand of an MSIL instruction that accesses methods, such as or , in the scope of the current object. Gets a token, valid in the scope of the current , representing a method on a generic type. The method. The generic type the method belongs to. A token that can be used as the operand of an MSIL instruction that accesses methods, such as or , in the scope of the current object. Gets a token, valid in the scope of the current , representing a type to be used in the associated dynamic method. The type to be used. A token that can be used as the operand of an MSIL instruction that requires a type, in the scope of the current object. Gets a token, valid in the scope of the current , representing a string literal to be used in the associated dynamic method. The string to be used. A token that can be used as the operand of an MSIL instruction that requires a string, in the scope of the current object. Sets the code body of the associated dynamic method. A pointer to a byte array containing the MSIL stream. The number of bytes in the MSIL stream. The maximum number of items on the operand stack when the method is executing. is and is greater than 0. is less than 0. Sets the code body of the associated dynamic method. An array that contains the MSIL stream. The maximum number of items on the operand stack when the method is executing. Sets the exception metadata for the associated dynamic method. A pointer to a byte array containing the exception metadata. The number of bytes of exception metadata. is and is greater than 0. is less than 0. Sets the exception metadata for the associated dynamic method. An array that contains the exception metadata. Sets the local variable signature that describes the layout of local variables for the associated dynamic method. An array that contains the layout of local variables for the associated . The number of bytes in the signature. is and is greater than 0. is less than 0. Sets the local variable signature that describes the layout of local variables for the associated dynamic method. An array that contains the layout of local variables for the associated . Defines and represents a dynamic method that can be compiled, executed, and discarded. Discarded methods are available for garbage collection. 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 . 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 if the method has no return type. An array of objects specifying the types of the parameters of the dynamic method, or if the method has no parameters. A representing the module with which the dynamic method is to be logically associated. to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method; otherwise, . An element of is or . -or- is a module that provides anonymous hosting for dynamic methods. is . -or- is . is a combination of flags other than and . -or- is not . -or- is a type for which returns . 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 . 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 if the method has no return type. An array of objects specifying the types of the parameters of the dynamic method, or 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. to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method; otherwise, . An element of is or . -or- is an interface, an array, an open generic type, or a type parameter of a generic type or method. is . -or- is . is a combination of flags other than and . -or- is not . -or- is a type for which returns . 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 . A object that specifies the return type of the dynamic method, or if the method has no return type. An array of objects specifying the types of the parameters of the dynamic method, or if the method has no parameters. An element of is or . is . is a type for which returns . 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 . A object that specifies the return type of the dynamic method, or if the method has no return type. An array of objects specifying the types of the parameters of the dynamic method, or if the method has no parameters. 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, . An element of is or . is . is a type for which returns . 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 . A object that specifies the return type of the dynamic method, or if the method has no return type. An array of objects specifying the types of the parameters of the dynamic method, or if the method has no parameters. A representing the module with which the dynamic method is to be logically associated. An element of is or . -or- is a module that provides anonymous hosting for dynamic methods. is . -or- is . is a type for which returns . 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 . A object that specifies the return type of the dynamic method, or if the method has no return type. An array of objects specifying the types of the parameters of the dynamic method, or if the method has no parameters. A representing the module with which the dynamic method is to be logically associated. to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method. An element of is or . -or- is a module that provides anonymous hosting for dynamic methods. is . -or- is . is a type for which returns . 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 . A object that specifies the return type of the dynamic method, or if the method has no return type. An array of objects specifying the types of the parameters of the dynamic method, or 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. An element of is or . -or- is an interface, an array, an open generic type, or a type parameter of a generic type or method. is . -or- is . is , or is a type for which returns . 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 . A object that specifies the return type of the dynamic method, or if the method has no return type. An array of objects specifying the types of the parameters of the dynamic method, or 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. to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method; otherwise, . An element of is or . -or- is an interface, an array, an open generic type, or a type parameter of a generic type or method. is . -or- is . is , or is a type for which returns . Gets the attributes specified when the dynamic method was created. A bitwise combination of the values representing the attributes for the method. Gets the calling convention specified when the dynamic method was created. One of the values that indicates the calling convention of the method. Completes the dynamic method and creates a delegate that can be used to execute it. A delegate type whose signature matches that of the dynamic method. A delegate of the specified type, which can be used to execute the dynamic method. The dynamic method has no method body. has the wrong number of parameters or the wrong parameter types. 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 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. A delegate of the specified type, which can be used to execute the dynamic method with the specified target object. The dynamic method has no method body. is not the same type as the first parameter of the dynamic method, and is not assignable to that type. -or- has the wrong number of parameters or the wrong parameter types. Gets the type that declares the method, which is always for dynamic methods. Always . Defines a parameter of the dynamic method. 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. Always returns . The method has no parameters. -or- is less than 0. -or- is greater than the number of the method's parameters. Returns the base implementation for the method. The base implementation of the method. Returns all the custom attributes defined for the method. to search the method's inheritance chain to find the custom attributes; to check only the current method. An array of objects representing all the custom attributes of the method. Returns the custom attributes of the specified type that have been applied to the method. A representing the type of custom attribute to return. to search the method's inheritance chain to find the custom attributes; to check only the current method. An array of objects representing the attributes of the method that are of type or derive from type . is . 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. Returns a Microsoft intermediate language (MSIL) generator for the method with a default MSIL stream size of 64 bytes. An object for the method. Returns a Microsoft intermediate language (MSIL) generator for the method with the specified MSIL stream size. The size of the MSIL stream, in bytes. An object for the method, with the specified MSIL stream size. Returns the implementation flags for the method. A bitwise combination of values representing the implementation flags for the method. Returns the parameters of the dynamic method. An array of objects that represent the parameters of the dynamic method. Gets or sets a value indicating whether the local variables in the method are zero-initialized. if the local variables in the method are zero-initialized; otherwise, . The default is . Invokes the dynamic method using the specified parameters, under the constraints of the specified binder, with the specified culture information. This parameter is ignored for dynamic methods, because they are static. Specify . 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 , 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 . An instance of used to govern the coercion of types. If this is , 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. A containing the return value of the invoked method. The calling convention is not supported. The number of elements in does not match the number of parameters in the dynamic method. The type of one or more elements of does not match the type of the corresponding parameter of the dynamic method. The dynamic method is associated with a module, is not anonymously hosted, and was constructed with set to , but the dynamic method accesses members that are not or ( in Visual Basic). -or- The dynamic method is anonymously hosted and was constructed with set to , but it accesses members that are not . -or- The dynamic method contains unverifiable code. See the "Verification" section in Remarks for . Indicates whether the specified custom attribute type is defined. A representing the type of custom attribute to search for. to search the method's inheritance chain to find the custom attributes; to check only the current method. if the specified custom attribute type is defined; otherwise, . Gets a value that indicates whether the current dynamic method is security-critical or security-safe-critical, and therefore can perform critical operations. if the current dynamic method is security-critical or security-safe-critical; if it is transparent. The dynamic method doesn't have a method body. Gets a value that indicates whether the current dynamic method is security-safe-critical at the current trust level; that is, whether it can perform critical operations and can be accessed by transparent code. if the dynamic method is security-safe-critical at the current trust level; if it is security-critical or transparent. The dynamic method doesn't have a method body. Gets a value that indicates whether the current dynamic method is transparent at the current trust level, and therefore cannot perform critical operations. if the dynamic method is security-transparent at the current trust level; otherwise, . The dynamic method doesn't have a method body. Not supported for dynamic methods. Not supported for dynamic methods. Not allowed for dynamic methods. Gets the module with which the dynamic method is logically associated. The with which the current dynamic method is associated. Gets the name of the dynamic method. The simple name of the method. Gets the class that was used in reflection to obtain the method. Always . Gets the return parameter of the dynamic method. Always . Gets the type of return value for the dynamic method. A representing the type of the return value of the current method; if the method has no return type. Gets the custom attributes of the return type for the dynamic method. An representing the custom attributes of the return type for the dynamic method. Returns the signature of the method, represented as a string. A string representing the method signature.