#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.