Attributes are allowed to declare what they can access (through the AttributeUsageAttribute attribute). The default value is anything, but in this case it is “assembly”, which means: you can only apply it at the assembly level, which you do with:
[assembly:Dependency(...)]
If this is your own attribute, check the AttributeUsageAttribute attribute associated with it and make sure that it includes properties (using the pipe | to apply "or").
If this is not your attribute, double check the intended use - you may use it incorrectly.
Marc gravell
source share