MethodImplOptions Enumeration

Defines the details of how a method is implemented.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace: System.Runtime.CompilerServices
Assembly: mscorlib (in mscorlib.dll)

public enum MethodImplOptions
/** @attribute SerializableAttribute() */ 
/** @attribute FlagsAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public enum MethodImplOptions
public enum MethodImplOptions

 Member nameDescription
Supported by the .NET Compact FrameworkForwardRefSpecifies that the method is declared, but its implementation is provided elsewhere. 
Supported by the .NET Compact FrameworkInternalCallSpecifies an internal call. An internal call is a call to a method implemented within the common language runtime itself. 
Supported by the .NET Compact FrameworkNoInliningSpecifies that the method can not be inlined. 
Supported by the .NET Compact FrameworkPreserveSigSpecifies that the method signature is exported exactly as declared. 
Supported by the .NET Compact FrameworkSynchronizedSpecifies that the method can be executed by only one thread at a time. Static methods lock on the type, while instance methods lock on the instance. Only one thread can execute in any of the instance functions and only one thread can execute in any of a class's static functions. 
Supported by the .NET Compact FrameworkUnmanagedSpecifies that the method is implemented in unmanaged code. 

Used with MethodImplAttribute.

Specify multiple MethodImplOptions values using the bit-wise OR operator.


Locking on the instance or on the type, as with the Synchronized flag, is not recommended for public types because code other than your own can take locks on public types and instances. This might cause deadlocks or other synchronization problems.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0