-
Notifications
You must be signed in to change notification settings - Fork 6k
.NET Framework -> .NET #21105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
.NET Framework -> .NET #21105
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,35 @@ | ||
| --- | ||
| title: "Extending Metadata Using Attributes" | ||
| description: Learn how to extend metadata using attributes in .NET. Attributes are keyword-like descriptive declarations to annotate programming elements, like types and fields. | ||
| ms.date: "03/30/2017" | ||
| ms.date: 10/14/2020 | ||
| ms.technology: dotnet-standard | ||
| helpviewer_keywords: | ||
| helpviewer_keywords: | ||
| - "metadata, extending" | ||
| - "attributes [.NET Framework], metadata" | ||
| - "elements [.NET Framework], attributes" | ||
| - "attributes [.NET], metadata" | ||
| - "elements [.NET], attributes" | ||
| - "common language runtime, attributes" | ||
| - "annotating programming elements" | ||
| - "keyword-like descriptive declarations" | ||
| - "runtime, attributes" | ||
| - "extending metadata" | ||
| ms.assetid: 30386922-1e00-4602-9ebf-526b271a8b87 | ||
| --- | ||
| # Extending Metadata Using Attributes | ||
| The common language runtime allows you to add keyword-like descriptive declarations, called attributes, to annotate programming elements such as types, fields, methods, and properties. When you compile your code for the runtime, it is converted into Microsoft intermediate language (MSIL) and placed inside a portable executable (PE) file along with metadata generated by the compiler. Attributes allow you to place extra descriptive information into metadata that can be extracted using runtime reflection services. The compiler creates attributes when you declare instances of special classes that derive from <xref:System.Attribute?displayProperty=nameWithType>. | ||
|
|
||
| The .NET Framework uses attributes for a variety of reasons and to address a number of issues. Attributes describe how to serialize data, specify characteristics that are used to enforce security, and limit optimizations by the just-in-time (JIT) compiler so the code remains easy to debug. Attributes can also record the name of a file or the author of code, or control the visibility of controls and members during forms development. | ||
|
|
||
| ## Related Topics | ||
|
|
||
| |Title|Description| | ||
| |-----------|-----------------| | ||
| |[Applying Attributes](applying-attributes.md)|Describes how to apply an attribute to an element of your code.| | ||
| |[Writing Custom Attributes](writing-custom-attributes.md)|Describes how to design custom attribute classes.| | ||
| |[Retrieving Information Stored in Attributes](retrieving-information-stored-in-attributes.md)|Describes how to retrieve custom attributes for code that is loaded into the execution context.| | ||
| |[Metadata and Self-Describing Components](../metadata-and-self-describing-components.md)|Provides an overview of metadata and describes how it is implemented in a .NET Framework portable executable (PE) file.| | ||
| |[How to: Load Assemblies into the Reflection-Only Context](../../framework/reflection-and-codedom/how-to-load-assemblies-into-the-reflection-only-context.md)|Explains how to retrieve custom attribute information in the reflection-only context.| | ||
|
|
||
| ## Reference | ||
| <xref:System.Attribute?displayProperty=nameWithType> | ||
| # Extend metadata using attributes | ||
|
|
||
| The common language runtime allows you to add keyword-like descriptive declarations, called attributes, to annotate programming elements such as types, fields, methods, and properties. When you compile your code for the runtime, it is converted into Microsoft intermediate language (MSIL) and placed inside a portable executable (PE) file along with metadata generated by the compiler. Attributes allow you to place extra descriptive information into metadata that can be extracted using runtime reflection services. The compiler creates attributes when you declare instances of special classes that derive from <xref:System.Attribute?displayProperty=nameWithType>. | ||
|
|
||
| .NET uses attributes for a variety of reasons and to address a number of issues. Attributes describe how to serialize data, specify characteristics that are used to enforce security, and limit optimizations by the just-in-time (JIT) compiler so the code remains easy to debug. Attributes can also record the name of a file or the author of code, or control the visibility of controls and members during forms development. | ||
|
|
||
| ## Related articles | ||
|
|
||
| |Title|Description| | ||
| |-----------|-----------------| | ||
| |[Applying Attributes](applying-attributes.md)|Describes how to apply an attribute to an element of your code.| | ||
| |[Writing Custom Attributes](writing-custom-attributes.md)|Describes how to design custom attribute classes.| | ||
| |[Retrieving Information Stored in Attributes](retrieving-information-stored-in-attributes.md)|Describes how to retrieve custom attributes for code that is loaded into the execution context.| | ||
| |[Metadata and Self-Describing Components](../metadata-and-self-describing-components.md)|Provides an overview of metadata and describes how it is implemented in a .NET Framework portable executable (PE) file.| | ||
| |[How to: Load Assemblies into the Reflection-Only Context](../../framework/reflection-and-codedom/how-to-load-assemblies-into-the-reflection-only-context.md)|Explains how to retrieve custom attribute information in the reflection-only context.| | ||
|
|
||
| ## Reference | ||
|
|
||
| - <xref:System.Attribute?displayProperty=nameWithType> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.