Assembly::IsDefined Method (Type^, Boolean)
Indicates whether or not a specified attribute has been applied to the assembly.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- attributeType
-
Type:
System::Type^
The type of the attribute to be checked for this assembly.
- inherit
-
Type:
System::Boolean
This argument is ignored for objects of this type.
Return Value
Type: System::Booleantrue if the attribute has been applied to the assembly; otherwise, false.
| Exception | Condition |
|---|---|
| ArgumentNullException | attributeType is null. |
| ArgumentException | attributeType uses an invalid type. |
The following code example applies the AssemblyTitleAttribute attribute to an assembly and then uses IsDefined to indicate whether it was applied. It also tests an attribute that was not applied.
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0