CLR Reading Notes-Chapter 2 generation, packaging, deployment and management of applications and types

Source: Internet
Author: User

2.1. NET Framework deployment target

1. Reasons for poor reputation:

@ 1 All ApplicationsProgramAll come from the dynamic link library DLL of each vendor,

@ 2 complex installation;

@ 3 Security;

2.. the. NET Framework is being passed to solve the DLL hell problem.

2.2 generate the type into a large module

1. How to add multiple typesSource codeFile is generated as a deployable File

2. Response file: a text file containing a set of compiler command line switches;

2.3 metadata Overview

A hosted PE file consists of four parts: pe32 (+) header, CLR header, metadata, and IL;

1. The pe32 (+) header is the standard information required by windows;

2. CLR header: unique to those modules that require CLR;

3. Metadata: a binary data block consisting of several tables: Definition table, reference table, and list table.

(1) Definition table

@ 1 moduledef: always contains a record item of the Identification Module;

@ 2 typedef: Each type defined in the module has a record item in this table;

@ 3 methoddef: each method defined in the module has a record item in this table;

@ 4 fielddef: each field defined in the module has a record item in this table;

@ 5 paramdef: each parameter defined in the module has a record item in this table;

@ 6 propertydef: Each attribute defined in the module has a record item in this table;

@ 7 eventdef: each event defined in the module has a record in this table;

(2) commonly used reference tables:

@ 1 assemblyref: each Assembly referenced in the module has a corresponding record item in this table;

@ 2 moduleref: The referenced module has a record item in this table;

@ 3 typeref: Each type referenced by the module has a record item in this table;

@ 4 memberref: each Member referenced in the module has a record in this table;

(3) List metadata tables: assemblydef, filedef, manifestresourcedef, exportedtypedef;

2.4 merge modules into an assembly

1. CLR always loads the file containing the "list" metadata table first, and then obtains the names of other files in the Assembly based on the list;

2. The Assembly separates the logic representation of reusable types from the physical representation.

3. Reasons for using multi-file assembly;

@ 1 Separate files can be used to divide the types;

@ 2 You can add resources or data files in your own set;

@ 3 each type included in the program can be implemented in different languages;

4. C # Switch to/T [arget]: EXE;/T [arget]: winexe;/T [arget]: Library; t [atget]: module -- generate the PE file of the metadata table without the list;

5. Use al.exe to create an assembly

2.5 assembly version Resource Information

1. You can use a custom attribute to set the version resource field. Vs will automatically create an assemblyinfo. CS file.

2. Version: 2.5.719.2 main version number. Minor version number. Internal version number. revision number;

@ 1 assemblyfileversion is for reference only;

@ 2 assemblyinfomationalversion is for reference only;

@ 3 assemblyversion is very important. It uniquely identifies an assembly;

2.6 Language and Culture

1. Language and culture are also part of the assembly identifier

2. Ancillary Assembly: an assembly that marks a specific language and culture;

Use al.exe to generate the affiliated Assembly and use the switch/C [ulture]: Text to specify a language. text is a language string.

2.7 Simple Application Deployment

1. Private deployment: deployment to the Assembly in the same directory as the application;

2.8 simple management and control

 

 

 

 

 

 

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.