Describe metadata in .NET | What is Metadata in .NET?
What is Metadata in .NET?
Metadata is information about the assemblies, modules, and types that constitute .NET programs.
In .NET, metadata is a common mechanism that the .NET runtime, compilers, and tools all can use. Microsoft .NET uses metadata to describe all types that are used and exposed by the particular .NET assembly.
In this sense, metadata describes an assembly in detail, including descriptions of its identity, the types that it references, the type that it exports, and the security requirements for execution. Much richer than a type library, metadata includes descriptions of an assembly and modules, classes, interfaces, methods, properties, fields, events, global methods, and so forth.
Metadata provides enough information for any runtime, tool, or program to find out literally everything that is needed for component integration.
Users of metadata in .NET
Following are the users that make intelligent use of metadata in .NET
1) CLR
The CLR uses metadata for verification, security enforcement, memory layout, and execution. The CLR relief heavily on metadata to support these runtime features.
2) Classloader
A component of the CLR, the class loader uses metadata to find load .NET classes. This is because metadata records detailed information for a specific class and where the class is located, whether it is in the same assembly, within or outside of a specific namespace, or in a dependent assembly somewhere on the network.
3) Just-in-time (JIT) compilers
JIT compilers use metadata to compile IL code. .NET JIT compiles IL into native code prior to execution and it does this using metadata.
4) Tools
Tools use metadata to support integration. Tools such as debuggers, profilers, and object browser can use metadata to provide richer development support.