ModuleBuilder.GetCustomAttributesData 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.

Returns information about the attributes that have been applied to the current ModuleBuilder, expressed as CustomAttributeData objects.

C#
public override System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData();

Returns

A generic list of CustomAttributeData objects representing data about the attributes that have been applied to the current module.

Remarks

Use this method to examine the custom attributes of code in the reflection-only context, in cases where the custom attributes themselves are defined in code that is loaded into the reflection-only context. Methods like Attribute.GetCustomAttributes and Assembly.GetCustomAttributes cannot be used in such cases, because they create instances of the attributes. Code in the reflection-only context cannot be executed. For more information and for example code, see the CustomAttributeData class.

Applies to

Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)