Has the CLR changed over the years?

Source: Internet
Author: User
Tags virtual environment

Introduction

First of all, I would like to recommend to beginners the "CLR via C #" This Good book, do. NET developers should read. Not to say why, but also for advertising. A link to the Watercress Book review is available here.

The CLR, which runs as a cross-platform for. Net programs, has a similar function to Java's JVM (Java is a cross-platform, which can be achieved without the JVM).

With the growing development of the. NET framework, the CLR has changed rapidly. These changes bring more useful features to development and improve the performance and stability of the program while improving development efficiency.

If you feel that it is necessary to update this piece of the better, please also feedback.

If it is useful to you, please click "Recommended", I will continue to update more new content.

What is the CLR?

The common language runtime (COMMONLANGUAGERUNTIOME,CLR) is first known as the next-generation Windows service runtime (NGWS Runtime). It is a virtual environment that is built directly on the operating system, and the main task is to manage the running of the code.

Location of the CLR in. netframework

. NET Platform structure diagram

The CLR now supports dozens of modern programming languages to write code for it and is then executed in the form of an intermediate language (intermediate Langeoage,il) code. Also, the CLR provides a number of features to simplify the development and application configuration of code, while also improving application reliability. As you know, if the compiler for a language is targeting the runtime, then developing the generated code with that language is in. NET is called managed code (MSIL), because such code is run directly on the CLR, so it has no platform-independent features.

What languages are currently supported by the CLR

Microsoft has developed CLR-based compilers for multiple languages including: C + +/CLI, C #, Visual Basic, F #, Iron Python, Iron Ruby, and IL.

In addition, other companies and universities have developed CLR-based compilers such as Ada, APL, Caml, COBOL, Eiffel, Forth, Fortran, Haskell, Lexicon, LISP, logos, Lua, Mercury, ML, Mondrian, Oberon, Pascal, Perl, PHP, Prolog, RPG, Scheme, Smaltak, TCL/TK.

In the. NET platform structure diagram, above the CLR is the base Class library for. NET, which includes a unified object-oriented, hierarchical, extensible programming interface from basic input and output to data access. As you can see from the. NET platform structure diagram, the base Class library can be called and extended by various languages, i.e. C#,VB. NET or f#,vc++.net, are free to call. NET's class library.

CLR internal structure

You can see the features that the CLR provides, such as type Checker, garbage collection (garbage Collector), exception handling (Exception Manager), backward compatibility (COM Marshaler), and so on, specifically. The CLR on the net provides the following services to developers:

    • platform-agnostic : The CLR actually provides a product that uses virtual machine technology, which, on top of the operating system, does not require that the program run on a Windows system, as long as it is a system that can support its runtime. NET applications. Therefore, an application consisting entirely of managed code, once compiled, can be supported at any time. NET to run on the platform. (from the advent of mono becomes more real, don't envy Java)
    • cross-language integration : CLR word order development This is developed in any language, with code developed in these languages that can be closely and seamlessly cross-called in a CLR environment, for example, you can declare a base class object in VB, and then create a derived class of the secondary base class directly in C # code.
    • Automatic memory Management : The CLR provides a Lycra collection mechanism that can automatically manage memory. When the life cycle of an object or variable is fast, the CLR automatically frees the memory they occupy.
    • Cross-language exception handling
    • version control (avoids DLL disaster)
    • . NET Security
    • Simple Component Interoperability .
    • self-describing component : a self-describing component is an execution file that puts all the data and code in one file. Self-describing components can greatly simplify the development and configuration of the system and improve the reliability of the system.

CLR execution

In the CLR's model of the entire. Net Framework program execution, C #, Vb.net,c++.net code generates MSIL (managed code) through the compiler, and then the CLR translates the JIT into native code, which can be executed directly.

CLR Version History

The C # version and the. Net Framework version, as well as CLR dependencies and new attributes, add a list

The. NET Framework 4.5 is a in-place update that replaces the. NET Framework 4 on your computer, and similiarly, the. Net Framework 4.5.1 4.5.2, and 4.6 RC is in-place updates to the. NET Framework 4.5, which means this they use the same runt IME version, but the assembly versions is updated and include new types and members. After you install one of the these updates, your. NET Framework 4 or. NET Framework 4.5 apps should continue to run without re Quiring recompilation. However, the reverse is not true. We do not recommend running apps, the target a later version of the. NET Framework on the. NET Framework 4.5.

The general meaning of the above is:

    • . NET Framework 4.5 is a replacement for. NETFramework 4.0
    • The. NET Framework 4.5.1 4.5.2, and 4.6 RC are replacements for. NETFramework 4.5

Starting with. NET 4, if you want to put the. NETFramework 4.0+ to the updated version of the update. NETFramework, simply re-specify the target. Net framwork and recompile the code, and vice versa.

The reason why you can do this is because of the few. The netframework version of the CLR is version 4.0.

The. NET Framework versions 2.0, 3.0, and 3.5 is built with the same version of the CLR (CLR 2.0). These versions represent successive layers of a single installation. Each version was built incrementally on top of the earlier versions. It is not possible to run versions 2.0, 3.0, and 3.5 side by side on a computer. When you install version 3.5, your get the 2.0 and 3.0 layers automatically, and apps that were built for versions 2.0, 3.0 , and 3.5 can all run on version 3.5. However, the. NET Framework 4 Ends this layering approach. Starting with the. NET Framework 4, you can use in-process side-by-side hosting to run multiple versions of the CLR in a s Ingle Process. For more information, see Assemblies and side-by-side execution.

In addition, if your app targets version 2.0, 3.0, or 3.5, your users could be required to enable the. NET Framework 3.5 on A Windows 8 or Windows 8.1 computer before they can run your app. For more information, see Installing the. NET Framework 3.5 on Windows 8 or 8.1

The meaning of this passage is

    • . NET Framework versions 2.0, 3.0, and 3.5 each version is incrementally developed on the previous version
    • The. NET Framework versions 2.0, 3.0, and 3.5 different versions of a program cannot run on different CLR simultaneously on the same machine. (After installing version 3.5, you will not need to install versions 2.0 and 3.0, and 2.0, 3.0, and 3.5 of the generated applications can be run on version 3.5)
    • Starting with the. NET Framework 4, in a single process, in-process parallelism can be used to run multiple versions of the CLR. (That is, 4.0 of the DLLs refer to 2.0 of the DLLs, 4.0 of the code runs on CLR4.0 and 2.0 of the code runs on CLR2.0)
    • In addition, if your application is using version 2.0, 3.0, or 3.5, your users may need to enable the. NET Framework 8.1 on Windows 8 or Windows 3.5 computers before they can run the application.

By the way, look at the new features of each. Net Framework:

Latest developments in the CLR

Future. NETFramework will have a new brother come in together. Build the dream of. Net cross-platform and cloud architecture.

The central core CLR is one of the most important core of ASP. Net Vnext, although not officially said, but basically a lite version of the CLR, take off the drawing and other functions, make the server and cloud program more efficient

As for MONOCLR, everyone knows the name to better support Mono, the open-source rookie.

Reference

Common language Runtime (CLR)

. NET Framework Versions and Dependencies

The future of. NET in the Server:ASP.NET VNext optimized for Cloud and Server workloads

. NET Versioning and multi-targeting-. NET 4.5 is a in-place upgrade to. NET 4.0.

Has the CLR changed over the years?

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.