Typically, an
assembly is an EXE or DLL and is similar in nature to an EXE or DLL in the unmanaged world,
but that??™s where the similarities end. Each assembly in the .NET world consists of the following:
??? Header information ??? Metadata
??? IL ??? Manifest
As you saw previously, the primary component of an assembly is IL, which is compiled on
the fly by the JIT compiler. Each assembly has a version attached to it, allowing multiple assemblies
with the same name but different versions to be separately identifiable. Each assembly
must also contain header information that provides information about the assembly to the
CLR. The header contains details about versions, entry points, metadata, and other low-level
details. You can see the assembly header information if you run the IL Disassembler and select
View ?¤Headers. The following shows you abbreviated header information for HelloWorld.exe:
----- DOS Header:
Magic: 0x5a4d
Bytes on last page: 0x0090
Pages in file: 0x0003
. . .
----- PE Optional Header (32 bit):
Magic: 0x010b
Major linker version: 0x08
Minor linker version: 0x00
Size of code: 0x00002000
. . .
Image sections:
.text
0x00001804 Virtual Size
0x00002000 Virtual Address
. . .
Base Relocation Table
0x00003000 Page RVA
0x0000000c Block Size
0x00000002 Number of Entries
CHAPTER 5 n VB 2008 AND THE CLR 88
.
Pages:
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173