The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
MethodBuilder::SetCustomAttribute Method (CustomAttributeBuilder^)
.NET Framework (current version)
Sets a custom attribute using a custom attribute builder.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- customBuilder
-
Type:
System.Reflection.Emit::CustomAttributeBuilder^
An instance of a helper class to describe the custom attribute.
| Exception | Condition |
|---|---|
| ArgumentNullException | customBuilder is null. |
| InvalidOperationException | For the current method, the IsGenericMethod property is true, but the IsGenericMethodDefinition property is false. |
The SetCustomAttribute method can interact with the SetImplementationFlags method when the two methods are used in combination. See the Remarks section of the SetImplementationFlags method for details.
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Available since 1.1
Silverlight
Available since 2.0
Show: