Excerpt from-it Enterprise must read 200. NET face questions-02. NET Framework Foundation

Source: Internet
Author: User

. NET Basic Concepts

What is the CTS, CLS, and CLR

The CTS is a common type system; The CLS is the common language specification; The CLR is the common language runtime.

Comparison of CLR technology and COM technology

Both the CLR and COM define specifications for interaction between components. COM does not define how to describe dependencies between components, and because of its strict physical conventions, it causes many component version upgrades and control issues. The CLR uses such mechanisms as metadata and logical type definitions to effectively solve some of the problems that COM has left behind. And, compared to the COM model, I think the CLR is easier to understand and learn.

What are assemblies and application domains

An assembly is a logical collection of type definitions, data files, and resource files. Each assembly contains an assembly manifest, which is typically attached to a file header, or you can set up a separate file to contain the manifest. An application domain is a logical unit in the CLR that provides code-running scopes, error isolation, and security settings that are functionally similar to the operating system's processes. One or more application domains run in the process of an operating system. The cost of creating and destroying an application domain is smaller than the operating system process. As with operating system processes, data sharing between application domains is quite difficult.

. NET operating mechanism

. NET program is compiled into what form of code

. NET program forms the CLR header, meta data, and intermediate code after the first compilation. The second compilation occurs when the runtime or deployment is implemented, and the result of the compilation is the machine code that is executable in the CLR.

How the JIT works

Before compiling the intermediate code, the JIT engine looks for the method's native machine code cache and determines whether it is available, if it is available directly, if it is unavailable, the JIT engine looks for the method stub in the type, finds the intermediate code, and compiles it.

Brief introduction to the loading mechanism of assemblies

The CLR actively loads the assembly through System.Reflection.Assembly.LoadFrom and System.Reflection.Assembly.Load. The former passes the location and the latter identifies the assembly by uniquely identifying 4 elements that strongly name the assembly. The CLR's loading mechanism is consistent with the Load method, and its intrinsic strategy is to find the assembly in turn through version policy, codebase location, application domain location, and application location.

How to configure the version policy for an assembly

The CLR supports setting a version policy at 3 levels, followed by application policy, publisher policy, and computer policy.

Build, deploy, and manage

How to generate a strongly signed assembly

An assembly that generates strong signatures requires a public/private key pair.

How to put an assembly into the GAC

You can simply drag to add an assembly to the GAC through the. NET Framework's Assembly Viewer, or you can use a command line to add it using tools such as Gacutil.exe.

Delayed signature and its role

Delay signing means that the private key encryption and digital signature of a strong signed assembly are deferred until the actual publication. Delayed signing improves the efficiency of the development testing phase and facilitates the organization and project team to manage their own private keys.

Excerpt from-it Enterprise must read 200. NET face questions-02. NET Framework Foundation

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.