Understanding of the assembly and understanding of the Assembly

Source: Internet
Author: User

Understanding of the assembly and understanding of the Assembly

CLR interprets an assembly as a collection of one or more types of definition files and resource files. Generally, files suffixed with dll or exe are actually an assembly. Add resource files to an assembly. For example, if you commonly Add a Special icon to a Winform desktop program, you can select project "properties" in Visual Studio ", then, add the resource file in the Application tab.

After the embedded icon, the executable file of the application will display its own icon.

In Jeffrey Richter's CLR via C #, an assembly can be divided into weak named assembly and strong named assembly. These two types of assembly are completely consistent in structure and both have the same PE file format, PE32 (+) header, CLR header, metadata, List table, and IL. The difference between the two is that the strongly-named Assembly uses the publisher's public/private key pair to sign and uniquely identifies the Assembly publisher. A strongly-named assembly has four important attributes, which jointly uniquely identify the Assembly: a file name (excluding the extension), a version number, and a language culture (culture) identity and a public key (actually a hash value derived from the public key, known as the public key tag public key token ). For example:

"MyType, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 499eadeddab65c4d ". Note that the file extension cannot be determined based on the "assembly ID string.

One concept that must be known when discussing an Assembly is Global Assembly Cache (GAC ). For. in NET3.5 and earlier versions, GAC is generally located in the following directory: C: \ Windows \ assembly;. NET4.0, GAC is located in the following directory: C: \ Windows \ Microsoft. NET \ assembly. Do not manually copy your Assembly files to the GAC directory because the GAC directory is structured and contains many subdirectories. The subdirectory names are generated by specific algorithms. Note that the weak naming assembly cannot be placed in GAC.

 

Related Article

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.