开始读Jeffrey Richter的Applied Microsoft Net Framework Programming,将自己的理解记录下来增加理解。
已经读到第二章了,就从第二章开始记吧!
Chapter 2: Building, Packaging, Deploying, and Administering Applications and Types
DOT NET Framework Deployment Goals
Previous Windows Pragram have three question:
1 DLL hell cause application unstale
2 Customers are diffuclt to manage installing application.
3 Security problem.Customers didn't know what the application have do.
Building Types into a Module
MSCorLib.dll is a special file in that it contains all the core types, such as bytes, integers,
characters, strings, and so on. In fact, these types are so frequently used that the C# compiler
automatically references this assembly.
A managed PE file has four main parts: the PE header, the CLR header, the metadata, and the intermediate language (IL).
The PE header is the standard information that Windows expects.
CLR header was defined as struct the IMAGE_COR20_HEADER(We can find the definition from the the CorHdr.h header file.
typedef struct IMAGE_COR20_HEADER
{
// Header versioning
ULONG cb;
USHORT MajorRuntimeVersion;
USHORT MinorRuntimeVersion;
// Symbol table and startup information
IMAGE_DATA_DIRECTORY MetaData;
ULONG Flags;
ULONG EntryPointToken;
// Binding information
IMAGE_DATA_DIRECTORY Resources;
IMAGE_DATA_DIRECTORY StrongNameSignature;
// Regular fixup and binding information
IMAGE_DATA_DIRECTORY CodeManagerTable;
IMAGE_DATA_DIRECTORY VTableFixups;
IMAGE_DATA_DIRECTORY ExportAddressTableJumps;
// Precompiled image info (internal use only - set to zero)
IMAGE_DATA_DIRECTORY ManagedNativeHeader;
} IMAGE_COR20_HEADER;
The metadata is a block of binary data that consists of several tables. There are three categories of
tables: definition tables, reference tables, and manifest tables.
Combining Modules to form an assembly
An assembly is a collection of one or more files containing type definitions and resource files,the following characteristics of assembly should be remembered:
An assembly defines the reusable types
An assembly is marked with a version number
An assembly can have secuity information associated with it