I am getting the following error from the description attribute as follows:
Attribute 'Description' is not valid on this declaration type. It is only valid on 'method' declarations.
public enum TestEnum
{
    [Description("Property 1")]
    Property1,
}
I have never had this error before and Google isn't shedding much light. I guess it is a reference issue, but I'm not really sure.
The DescriptionAttribute can be applied to virtually any type of member, including enum values. Are you sure you're using the right [Description]? Make sure you reference the assembly it comes from:
using System.ComponentModel;
And, if you do happen to have two different attributes called 'Description' in your scope, prefix it with the namespace to remove the ambiguity, i.e.
enum MyEnum {
    [System.ComponentModel.Description("Blah")]
    MyValue
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With