TypeBuilder::SetCustomAttribute Method (CustomAttributeBuilder^)
.NET Framework (current version)
Set 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 define the custom attribute.
| Exception | Condition |
|---|---|
| ArgumentNullException | customBuilder is null. |
| InvalidOperationException | For the current dynamic type, the IsGenericType property is true, but the IsGenericTypeDefinition property is false. |
Note |
|---|
Starting with the .NET Framework 2.0 Service Pack 1, this member no longer requires ReflectionPermission with the ReflectionPermissionFlag::ReflectionEmit flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the .NET Framework 3.5 or later. |
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Available since 1.1
Silverlight
Available since 2.0
Show:
