In most cases they are the same. As already mentioned, you can usually use them interchangeably, unless both DefaultValue and DefaultValueAttribute defined. You can use both of these methods without ambiguity using the identifier verbatim ( @ ).
Section 17.2 of C # LS makes this clearer:
[AttributeUsage(AttributeTargets.All)] public class X: Attribute {} [AttributeUsage(AttributeTargets.All)] public class XAttribute: Attribute {} [X]
This refers to the actual use of the attribute. Of course, if you need to use the type name, for example when using typeof or reflection, you will need to use the actual name that you gave the type.
source share