MetadataBuilder.AddCustomAttribute Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds a custom attribute.
public:
System::Reflection::Metadata::CustomAttributeHandle AddCustomAttribute(System::Reflection::Metadata::EntityHandle parent, System::Reflection::Metadata::EntityHandle constructor, System::Reflection::Metadata::BlobHandle value);
public System.Reflection.Metadata.CustomAttributeHandle AddCustomAttribute (System.Reflection.Metadata.EntityHandle parent, System.Reflection.Metadata.EntityHandle constructor, System.Reflection.Metadata.BlobHandle value);
member this.AddCustomAttribute : System.Reflection.Metadata.EntityHandle * System.Reflection.Metadata.EntityHandle * System.Reflection.Metadata.BlobHandle -> System.Reflection.Metadata.CustomAttributeHandle
Public Function AddCustomAttribute (parent As EntityHandle, constructor As EntityHandle, value As BlobHandle) As CustomAttributeHandle
Parameters
- parent
- EntityHandle
An entity to attach the custom attribute to: a MethodDefinitionHandle, FieldDefinitionHandle, TypeReferenceHandle, TypeDefinitionHandle, ParameterHandle, InterfaceImplementationHandle, MemberReferenceHandle, ModuleDefinitionHandle, DeclarativeSecurityAttributeHandle, PropertyDefinitionHandle, EventDefinitionHandle, StandaloneSignatureHandle, ModuleReferenceHandle, TypeSpecificationHandle, AssemblyDefinitionHandle, AssemblyReferenceHandle, AssemblyFileHandle, ExportedTypeHandle, ManifestResourceHandle, GenericParameterHandle, GenericParameterConstraintHandle, or a MethodSpecificationHandle.
- constructor
- EntityHandle
A custom attribute constructor: a MethodDefinitionHandle or MemberReferenceHandle.
- value
- BlobHandle
A custom attribute value blob.
Returns
A handle to the added custom attribute.
Exceptions
parent
doesn't have the expected handle kind.
Remarks
Entries may be added in any order. The table is automatically sorted when serialized.
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for