Docs: Why would anyone use this?

Created on 20 Jan 2019  Â·  2Comments  Â·  Source: dotnet/docs

That is a more fundamental question.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Area - .NET Guide

Most helpful comment

Thanks for your feedback, @LJ9999.

There's a general description of attributes and the reasons for using them in the top-level Extending metadata using attributes article, as well as in the Attribute class documentation. Attributes are stored as metadata, are discoverable through reflection, and support custom behavior of program elements such as assemblies, types, and methods. They are typically used by tools or the common language runtime itself. For example, the ObsoleteAttribute is used by language compilers to determine whether the use of that program element generates a compiler warning or error. The FlagsAttribute modifies the behavior of the ToString method of enumeration types.

Although the existing content that discusses why attributes are used could be improved, it is at least adequate. I'm going to close this issue as Not Repro.

All 2 comments

Thanks for your feedback, @LJ9999.

There's a general description of attributes and the reasons for using them in the top-level Extending metadata using attributes article, as well as in the Attribute class documentation. Attributes are stored as metadata, are discoverable through reflection, and support custom behavior of program elements such as assemblies, types, and methods. They are typically used by tools or the common language runtime itself. For example, the ObsoleteAttribute is used by language compilers to determine whether the use of that program element generates a compiler warning or error. The FlagsAttribute modifies the behavior of the ToString method of enumeration types.

Although the existing content that discusses why attributes are used could be improved, it is at least adequate. I'm going to close this issue as Not Repro.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sime3000 picture sime3000  Â·  3Comments

stjepan picture stjepan  Â·  3Comments

ygoe picture ygoe  Â·  3Comments

LJ9999 picture LJ9999  Â·  3Comments

svick picture svick  Â·  3Comments