Code inspection: Redundant [AttributeUsage] attribute property assignment
This inspection reports a property assignment inside [AttributeUsage(...)] when the assigned value is redundant. That happens when the value is the default anyway, or when a property such as Inherited does not make sense for the selected attribute targets.
Example
using System;
[AttributeUsage(AttributeTargets.Method, Inherited = true)]
sealed class MyAttribute : Attribute
{
}
using System;
[AttributeUsage(AttributeTargets.Method)]
sealed class MyAttribute : Attribute
{
}
Quick-fix
The fix keeps the attribute behavior the same while removing unnecessary noise from the declaration.
13 April 2026