IL2031: Could not resolve custom attribute specified in a custom attribute annotations file

Cause

Could not resolve custom attribute from the type name specified in the fullname argument of an attribute element in a custom attribute annotations file.

Rule description

Custom attribute annotation files are used to instruct the trimmer to behave as if the specified item has a given attribute. Attribute annotations can only be used to add attributes which have effect on the trimmer behavior, all other attributes will be ignored. Attributes added via attribute annotations only influence the trimmer behavior and they are never added to the output assembly.

An attribute specified in a custom attribute annotations file could not be found in the assembly matching the fullname argument that was passed to the parent of the attribute element.

Example

<!-- IL2031: Attribute type 'NonExistentTypeAttribute' could not be found -->
<linker>
  <assembly fullname="MyAssembly">
    <attribute fullname="NonExistentTypeAttribute"/>
  </assembly>
</linker>