MethodImplAttributes Enumeration
TOC
Collapse the table of content
Expand the table of content

MethodImplAttributes Enumeration

 

This API supports the product infrastructure and is not intended to be used directly from your code.

Specifies flags for the attributes of a method implementation.

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

[SerializableAttribute]
[ComVisibleAttribute(true)]
public enum MethodImplAttributes

Member nameDescription
AggressiveInlining

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies that the method should be inlined wherever possible.

CodeTypeMask

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies flags about code type.

ForwardRef

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies that the method is not defined.

IL

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies that the method implementation is in Microsoft intermediate language (MSIL).

InternalCall

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies an internal call.

Managed

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies that the method is implemented in managed code.

ManagedMask

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies whether the method is implemented in managed or unmanaged code.

MaxMethodImplVal

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies a range check value.

Native

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies that the method implementation is native.

NoInlining

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies that the method cannot be inlined.

NoOptimization

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies that the method is not optimized by the just-in-time (JIT) compiler or by native code generation (see Ngen.exe) when debugging possible code generation problems.

OPTIL

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies that the method implementation is in Optimized Intermediate Language (OPTIL).

PreserveSig

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies that the method signature is exported exactly as declared.

Runtime

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies that the method implementation is provided by the runtime.

Synchronized

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies that the method is single-threaded through the body. Static methods (Shared in Visual Basic) lock on the type, whereas instance methods lock on the instance. You can also use the C# lock statement or the Visual Basic SyncLock statement for this purpose.

Unmanaged

This API supports the product infrastructure and is not intended to be used directly from your code. Specifies that the method is implemented in unmanaged code.

The attributes are combined using the bitwise OR operation as follows:

Code implementation masks:

  • CodeTypeMask

  • IL

  • Native

  • OPTIL

  • Runtime

Managed masks:

  • ManagedMask

  • Unmanaged

  • Managed

Implementation information and interop masks:

  • ForwardRef

  • PreserveSig

  • InternalCall

  • Synchronized

  • NoInlining

  • NoOptimization

  • MaxMethodImplVal

System_CAPS_noteNote

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.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft