MethodImplAttributes Enumeration

Specifies the attributes of a method implementation.

public enum MethodImplAttributes
: short
{
    IL = 0,
    Native = 1,
    Optical = 2,
    InternalCall = 4194304,
    Synchronized = 1048576,
    NoInlining = 8,
    ForwardRef = 16,
    PreserveSig = 128,
    AggressiveInlining = 256,
    AggressiveOptimization = 512,
    InternalBestFit = 65536,
    SecurityOptimized = 131072,
    ManagedMask = 4,
    Managed = 0,
    UnmanagedMask = 0,
    Unmanaged = 1
}
                    

Remarks

The MethodImplAttributes enumeration is used by the MethodBase.GetMethodImplementationFlags method to retrieve the implementation attributes of a method. These attributes describe how a method is implemented, such as whether it is written in IL, native code, or is an internal call.

IL

IL = 0

The method is implemented in Microsoft intermediate language (MSIL).

Native

Native = 1

The method is implemented in native code.

Optical

Optical = 2

The method is implemented using a runtime specific intermediate language.

InternalCall

InternalCall = 4194304

The method is an internal call, meaning it is implemented within the CLR.

Synchronized

Synchronized = 1048576

The method is synchronized. Only one thread can execute the method at a time.

NoInlining

NoInlining = 8

The method should not be inlined by the Just-In-Time (JIT) compiler.

ForwardRef

ForwardRef = 16

The method is defined elsewhere; the definition is not included in this module.

PreserveSig

PreserveSig = 128

The method's metadata signature is preserved exactly as defined.

AggressiveInlining

AggressiveInlining = 256

The method is a candidate for aggressive inlining by the JIT compiler.

AggressiveOptimization

AggressiveOptimization = 512

The method is a candidate for aggressive optimization by the JIT compiler.

InternalBestFit

InternalBestFit = 65536

Reserved for runtime use. Indicates best-fit mapping.

SecurityOptimized

SecurityOptimized = 131072

The method has been optimized for security.

ManagedMask

ManagedMask = 4

Mask to extract managed code attributes.

Managed

Managed = 0

The method is managed code.

UnmanagedMask

UnmanagedMask = 0

Mask to extract unmanaged code attributes.

Unmanaged

Unmanaged = 1

The method is unmanaged code.