System.Reflection.Emit.MethodBuilder.SetCustomAttribute Method

Sets a custom attribute using a specified custom attribute blob.

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public void SetCustomAttribute (System.Reflection.ConstructorInfo con, byte[] binaryAttribute)

Parameters

con
The constructor for the custom attribute.
binaryAttribute
A byte blob representing the attributes.

Remarks

For details on how to format binaryAttribute, see the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics". The documentation is available online; see tp://go.microsoft.com/fwlink/?LinkID=99212 on MSDN and tp://go.microsoft.com/fwlink/?LinkID=65552 on the Ecma International Web site.

The erload:System.Reflection.Emit.MethodBuilder.SetCustomAttribute method can interact with the MethodBuilder.SetImplementationFlags(System.Reflection.MethodImplAttributes) method when the two methods are used in combination. See the Remarks section of the MethodBuilder.SetImplementationFlags(System.Reflection.MethodImplAttributes) method for details.

Requirements

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