. NET Framework learning notes

Source: Internet
Author: User

The. NET platform consists of the operating system,. net enterprise-level server products,. NET web service components (passport), and. NET Framework.
The. NET Framework includes the Common Language Runtime (CLR) and a public class framework used by all. Net Supported languages ----- FCL (framework class library) currently supports 20 languages. FCL has a total of 99 namespaces.
There are three types of runtime environments: Pure static environment, pure dynamic environment, and stack-based environment. CLR is a type of pure dynamic operation. The main component is Vee (virtual execution engine). The main task is to manage and execute code written in. NET language.
CLR execution process: first, the class loader finds and loads the object, activates it, And then verifies its type, JIT then compiles and converts the Il code, and dynamically optimizes the code of the target machine and executes the code and other services (such as security detection, exception handling, and height) the execution component is responsible for automatically recycling useless object Resources.

??? CLI (Common Language infrastructure public language infrastructure) mainly includes CTS (common type system), CLS (Common Language Specification public Language Specification) and Ves (virtual execution system ).
CTS is at the core. It is a unified type system shared by compilers, tools, applications, and CLI.. NET platform has the performance of multi-language integration and is also the guarantee of type security. It can support both object-oriented languages and C languages. There are two types: Value Type and reference type.
CLS is composed of 41 rules and other regulations. It is complementary to CTS and aims to improve the accessory-level interoperability of libraries and written advanced languages.

Managed code is written in a language supported by. NET Framework .. Net Framework provides several core runtime services for these code to be executed. Therefore, these codes must provide the CLR with the most basic information, which is called "metadata ". Data in the program is represented in the brackets before the class or before the function. You can inherit system. attribute to create your own metadata features, such:
[Attributeusage (attributetargets. Class)]
Public class implements redbyattribute: system. Attribute
{
?? Public String comment redb;
}
An accessory is an application or library with one or more main entries. Accessories can be referenced. Private and shared accessories are available. Private accessories are stored in a single application directory, and shared accessories are stored in the global accessory cache (GAC). You can use gacutil-I somedll. DLL to register them with GAC as shared accessories. There is version coordination for shared accessories, that is, enhanced version constraints for shared accessories.
The version number is composed of four digits (for example, 5.5.2.33). If the first two digits have any different accessories, the version number is considered incompatible. If the third digit is different, it is considered to be "possibly compatible". If the fourth difference is true, it is considered compatible. These rules can be specified through the configuration file.
A list of accessories is a description, including resources, types, and references.
The runtime component is responsible for managing object life and the system that occupies heap memory .. Net Garbage Collector working mechanism: periodically traverses the list of currently referenced objects. All undiscovered objects are destroyed and the occupied memory is reclaimed.
Serialization refers to the process of converting an object into a byte stream. deserialization is the process of building an object from a byte stream.
??????? Code access security: CAS is a part of the. NET security model. It determines whether a specific code can be executed and what resources are used. You can use caspol-LG to view CAS code groups on the machine.

Example: caspol-Ag 1.3-site www.pconline.com.cn fulltrust ?? To use the website to completely access your machine.
?????? Reflection: You can use programming to access the metadata of an assembly. Because the assembly is self-describing, that is, the Assembly contains the metadata description of itself, therefore, you can access your metadata through reflection .. Net itself has some base classes to implement reflection.

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.