Friday, April 30, 2010

What is Metadata and Manifest?

1 comment:

Jasmine said...

Metadata :-
Metadata is binary information describing the program that is stored either in a common language runtime portable executable (PE) file or in memory. When you compile your code into a PE file, metadata is inserted into one portion of the file, while the code is converted to Microsoft intermediate language (MSIL) and inserted into another portion of the file. Every type and member defined and referenced in a module or assembly is described within metadata. When code is executed, the runtime loads metadata into memory and references it to discover information about your code's classes, members, inheritance, and so on.

Metadata stores the following information:
1) Description of the assembly.
- The types available in that assembly, viz. classes, interfaces, enums, structs, etc., and their containing namespaces
- The types that are exported.
- Other assemblies that this assembly depends on.
- Security permissions needed to run.
2) Description of types.
- Name, visibility, base class, and interfaces implemented.
- Members (methods, fields, properties, events, nested types).
3) Attributes.
- Additional descriptive elements that modify types and members.

Manifest :-
The assembly manifest contains this assembly metadata. An assembly manifest contains all the metadata needed to specify the assembly's version requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes. The assembly manifest can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a standalone PE file that contains only assembly manifest information.

Following information is store in an manifest
- Assembly name
- Version number - A major and minor version number, and a revision and build number. The common language runtime uses these numbers to enforce version policy.
- Information on the culture or language the assembly supports.
- Strong name information -The public key from the publisher if the assembly has been given a strong name.
- List of all files in the assembly
- Type reference information,this is used for types that are exported from the assembly.