DynamicMethod Constructor (String, MethodAttributes, CallingConventions, Type, array<Type>[]()[], Module, Boolean)

For apps that target Windows Phone OS 7.0 and 7.1, do not use this member in your app. If you do, your code will throw a MethodAccessException. This member is security-critical, which restricts it to internal use by the .NET Framework for Windows Phone class library.


[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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.

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


<SecurityCriticalAttribute> _
Public Sub New ( _
    name As String, _
    attributes As MethodAttributes, _
    callingConvention As CallingConventions, _
    returnType As Type, _
    parameterTypes As Type(), _
    m As Module, _
    skipVisibility As Boolean _
public DynamicMethod(
    string name,
    MethodAttributes attributes,
    CallingConventions callingConvention,
    Type returnType,
    Type[] parameterTypes,
    Module m,
    bool skipVisibility


  • name
    Type: System..::.String
    The name of the dynamic method. This can be a zero-length string, but it cannot be nullNothingnullptra null reference (Nothing in Visual Basic).
  • returnType
    Type: System..::.Type
    A Type object that specifies the return type of the dynamic method, or nullNothingnullptra null reference (Nothing in Visual Basic) if the method has no return type.
  • parameterTypes
    Type: array<System..::.Type>[]()[]
    An array of Type objects specifying the types of the parameters of the dynamic method, or nullNothingnullptra null reference (Nothing in Visual Basic) if the method has no parameters.
  • skipVisibility
    Type: System..::.Boolean
    true to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method; otherwise, false.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1


Windows Phone

See Also


DynamicMethod Class

DynamicMethod Overload

System.Reflection.Emit Namespace