System.Reflection.Emit.MethodBuilder.SetImplementationFlags Method

Sets the implementation flags for this method.

Syntax

public void SetImplementationFlags (System.Reflection.MethodImplAttributes attributes)

Parameters

attributes
The implementation flags to set.

Remarks

When you use the MethodBuilder.SetImplementationFlags(System.Reflection.MethodImplAttributes) method in combination with the erload:System.Reflection.Emit.MethodBuilder.SetCustomAttribute method, be aware of potential interactions. For example, using the erload:System.Reflection.Emit.MethodBuilder.SetCustomAttribute method to add the System.Runtime.InteropServices.DllImportAttribute attribute also sets the System.Reflection.MethodImplAttributes.PreserveSig flag. If you subsequently call the MethodBuilder.SetImplementationFlags(System.Reflection.MethodImplAttributes) method, the System.Reflection.MethodImplAttributes.PreserveSig flag is overwritten. There are two ways to avoid this:

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0