Returns an instance of a specified custom attribute if a single instance of the attribute is in the metadata for the specified assembly.
- element
- A System.Reflection.Assembly instance.
- attributeType
- The Type of the custom attribute for which to check.
The single instance of Attribute of type attributeType that is applied to element. Returns null if the specified attribute was not found.
Type Reason ArgumentNullException element or attributeType is null. ArgumentException attributeType is not a type derived from Attribute. System.Reflection.AmbiguousMatchException More than one instance of the specified custom attribute was found.
Note: If multiple instances of attributeType can be applied to element, use Attribute.GetCustomAttributes(System.Reflection.MemberInfo, Type).
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0