Last but not least, remember that a .NET assembly also contains metadata that describes the
assembly itself (technically termed a manifest). Among other details, the manifest documents all
external assemblies required by the current assembly to function correctly, the assembly’s version
number, copyright information, and so forth. Like type metadata, it is always the job of the compiler
to generate the assembly’s manifest. Here are some relevant details of the manifest generated
when compiling the Calc.cs code file shown earlier in this chapter (assume we instructed the compiler
to name our assembly Calc.exe):
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 2:0:0:0
}
.assembly Calc
{
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.module Calc.exe
.imagebase 0x00400000
.subsystem 0x00000003
.file alignment 512
.corflags 0x00000001
16 CHAPTER 1 n THE PHILOSOPHY OF .NET
In a nutshell, this manifest documents the list of external assemblies required by Calc.exe (via
the .assembly extern directive) as well as various characteristics of the assembly itself (version
number, module name, and so on). Chapter 15 will examine the usefulness of manifest data in
much more detail.
No comments:
Post a Comment