2,000 Things You Should Know About C#

Everything a C# Developer Needs to Know, in Bite-Sized Chunks

  • Home
  • About
  • Index
Posts Comments
  • Basics
  • Classes
  • Data Types
  • Methods
  • Exceptions
  • Visual Studio
  • Strings
  • Miscellaneous
  • Operators
  • Statements

#467 – Metadata

December 2, 2011 1 Comment

Metadata in .NET is data that describes an application’s code.  You can think of it as a description of the code, or as all the data stored with an assembly that isn’t the code.

Metadata is typically stored within a .NET assembly, along with the code.  It describes all of the types in the assembly, their members and the assembly itself.

Metadata is used in several different ways:

  • By tools that work with code, to provide information about the code  (e.g. Intellisense)
  • By the CLR, informing it about how the code is to be run  (e.g. marshaling)
  • By the JIT compiler, when converting IL to native code
  • For documentation purposes–metadata can be used to document code

You view metadata using the IL Disassembler tool (ILDASM).  The example below shows using ILDASM to examine the IMakeMilk interface defined in an assembly.

Filed under Basics Tagged with Basics, C#, Metadata

Sean Sexton

Recent Posts

  • #1,219 – C# 6.0 – Filtering Exceptions
  • #1,218 – C# 6.0 – Using Expression-Bodied Property Getters
  • #1,217 – C# 6.0 – Using Expression-Bodied Methods
  • #1,216 – C# 6.0 – Initializing Read-Only Auto-Properties from Constructors
  • #1,215 – C# 6.0 – New Syntax for Dictionary Initializers

Blogroll

  • 2,000 Things You Should Know About WPF
  • Britannica Geek
  • Sean on Twitter
  • Sean's Stuff

Calendar

December 2011
S M T W T F S
 123
45678910
11121314151617
18192021222324
25262728293031
« Nov   Jan »

Top Posts

  • Index
  • #744 - The Purpose of Inheritance
  • #820 - A Protected Constructor Allows a Subclass to Create Instances
  • #982 - An Enum Type Can Store a Maximum of 32 Flags
  • #443 - An Interface Cannot Contain Fields
  • #143 - An Example of Implementing ICloneable for Deep Copies
  • #282 - Creating Private Static Methods
  • #349 - The Difference Between Virtual and Non-Virtual Methods
  • #535 - Creating a Generic Struct
  • #815 - Named vs. Positional Arguments

Tags

#define #if 6.0 Accessibility Anonymous Types Arguments Array Arrays Basics Boxing C# catch Class Class Diagram Classes Collections Constants Constructor Constructors Conversions Covariance Data Types Deep Copy Delegate Delegates Enum Enumeration Equals Events Exceptions Fields Finalizer Floating Point foreach Garbage Collection Generic Generics Heap IEnumerable Inheritance Intellisense Interface Interfaces Lambda Expression Main Memory Methods Miscellaneous Namespaces new null Nullable Object Object Initializer Operators Optional Parameters override Parameters Patterns Polymorphism Private Properties Public Reference Types Statements Static Strings struct Throw try Unicode Value Types Variables virtual Visual Studio

Blog Stats

  • 2,677,723 hits

Create a free website or blog at WordPress.com.

Cancel
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy