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.

Advertisement

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

  • #982 - An Enum Type Can Store a Maximum of 32 Flags
  • #877 - Unhandled Exceptions on Background Threads
  • #178 - Throwing an Exception from a switch Statement
  • About
  • #1,170 - You Can't Unsubscribe from an Event Using a Lambda Expression
  • #820 - A Protected Constructor Allows a Subclass to Create Instances
  • #1,204 - C# 6.0 - Using Null-Conditional with Indexer
  • #876 - Unhandled Exceptions
  • #878 - Unhandled Exceptions in Static Constructors
  • #443 - An Interface Cannot Contain Fields

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,839,677 hits

Create a free website or blog at WordPress.com.

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
  • Follow Following
    • 2,000 Things You Should Know About C#
    • Join 367 other followers
    • Already have a WordPress.com account? Log in now.
    • 2,000 Things You Should Know About C#
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...