| Author: Gaurav Agrawal 09 May 2008 | Member Level: Gold | Rating: Points: 2 |
Manifest & Strong Name
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 (Portable Executable) file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a standalone PE (Portable Executable) file that contains only assembly manifest information.
The following table shows the information contained in the assembly manifest. The first four items — the assembly name, version number, culture, and strong name information — make up the assembly's identity.
Assembly name: A text string specifying the assembly's 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.
Culture: Information on the culture or language the assembly supports. This information should be used only to designate an assembly as a satellite assembly containing culture- or language-specific information. (An assembly with culture information is automatically assumed to be a satellite assembly.)
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: A hash of each file contained in the assembly and a file name. Note that all files that make up the assembly must be in the same directory as the file containing the assembly manifest.
Type reference information: Information used by the runtime to map a type reference to the file that contains its declaration and implementation. This is used for types that are exported from the assembly.
Information on referenced assemblies: A list of other assemblies that are statically referenced by the assembly. Each reference includes the dependent assembly's name, assembly metadata (version, culture, operating system, and so on), and public key, if the assembly is strong named.
|
| Author: Gaurav Agrawal 09 May 2008 | Member Level: Gold | Rating: Points: 2 |
Metadata describes the contents in an assembly, whereas the manifest describes the assembly itself, providing the logical attributes shared by all the modules and all components in the assembly. The manifest contains the assembly name, version number, locale and an optional strong name that uniquely identifying the assembly. This manifest information is used by the CLR. The manifest also contains the security demands to verify this assembly. It also contains the names and hashes of all the files that make up the assembly. The .NET assembly manifest contains a cryptographic hash of different modules in the assembly. And when the assembly is loaded, the CLR recalculates the hash of the modules at hand, and compares it with the embeded hash. If the hash generated at runtime is different from that found in the manifest, .NET refuses to load the assembly and throws an exception. This is different from COM, under COM it is possible to swap an original DLL or EXE file with another, which have same Type Libraries/Interfaces and cause damage to the system, by running malacious code. The manifest is also generated automatically by the high-level compiler from the source files of all modules in the assembly. Manifest is embeded to only one physical file and only once since it is common for all the modules in an assembly, whereas the metadata needs to be embeded all the modules. The .NET CLR compatible compilers must generate the manifest and it should be in the standard format. Using the manifest .NET captures information about other referenced assemblies. This ensures version compatibility, and the assembly gets to interact with the exact trusted set of other assemblies it expects. The manifest contains every referenced assembly name, its public key (if a strong name is available), its version number, and locale. While running this assembly, .NET guarantees that only these specific assemblies are used, and that only compatible versions are loaded.
|
| Author: mansi 09 May 2008 | Member Level: Bronze | Rating: Points: 2 |
Hi gaurav,materual on mnaifest is excellent but It will be better if u send me more info on matadata. Metadata describes the contents of assmebly--???Which contents??
|