System.Reflection.Emit.DynamicMethod.GetCustomAttributes Method

Returns all the custom attributes defined for the method.

Syntax

public override object[] GetCustomAttributes (bool inherit)

Parameters

inherit
true to search the method's inheritance chain to find the custom attributes; false to check only the current method.

Returns

An array of objects representing all the custom attributes of the method.

Remarks

For dynamic methods, specifying true for inherit has no effect, because the method is not declared in a type.

Note:

Custom attributes are not currently supported on dynamic methods. The only attribute returned is System.Runtime.CompilerServices.MethodImplAttribute; you can get the method implementation flags more easily using the DynamicMethod.GetMethodImplementationFlags method.

Requirements

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