.NET Technology Framework and Common Language Runtime(CLR)
.NET technology framework
It is a framework of software which had been developed by Microsoft,USA having a large library and also supporting programming language interoperability. Programs written for the .NET Framework execute in a specific software environment called Common Language Runtime (CLR) which provides services such as security, memory management, and exception handling. Hence, the combination of both the class library and the CLR forms the .NET Framework.
The library also called as base class library has library for user interface, database connectivity, cryptography, web application development and network communications. Software development in .Net framework can be done by and IDE by Microsoft called Visual Studio.
Version History
Each new version of the .NET Framework adds new features while keeping the features of previous versions and similarly the CLR has its own version number also. The version history for >net framework is given below
The .NET Framework versions 2.0, 3.0, and 3.5 have the same CLR version (CLR 2.0). Some version of the .NET Framework are installed with the Windows operating system as
Client operating system | Includes | You can also install |
---|---|---|
Windows 8 | .NET Framework 4.5 | |
Windows 7 | .NET Framework 3.5 SP1 | .NET Framework 4.5, .NET Framework 4 |
Windows Vista SP2 | .NET Framework 3.0 SP2 | .NET Framework 4.5, .NET Framework 4, .NET Framework 3.5 SP1 |
Windows XP Professional and Windows XP Home Edition | — | .NET Framework 4, .NET Framework 3.5 SP1, .NET Framework 2.0 SP2 |
The following table provides similar information for server operating systems.
Server operating system | Includes | You can also install |
---|---|---|
Windows Server 2012 | .NET Framework 4.5 | .NET Framework 3.5 SP1 |
Windows Server 2008 R2 | .NET Framework 2.0 SP2 (enabled by default), .NET Framework 3.5 SP1*, .NET Framework 3.0 SP2* | .NET Framework 4.5, .NET Framework 4 |
Windows Server 2008 SP2 | .NET Framework 2.0 SP2 (enabled by default), .NET Framework 3.0 SP2* | .NET Framework 4.5, .NET Framework 4, .NET Framework 3.5 SP1 |
Windows Server 2003 | .NET Framework 2.0 SP2 | .NET Framework 4, .NET Framework 3.5 SP1, .NET Framework 3.0 SP2 |
Design features of .Net Framework
The basic design features of .Net framework are listed below and they encompass all modern requirements for developing applications
Interoperability – The .NET Framework supports access to functionality implemented in newer and older programs like access to COM components.
Common Language Runtime engine – The Common Language Runtime (CLR) is the execution engine of the .NET Framework. which guarantee memory management, security, and exception handling.
Language independence – The .NET Framework has Common Type System, or CTS which defines datatypes and programming constructs supported by the CLR and their conformance to the Common Language Infrastructure (CLI) specification. Thus, supporting the exchange of types and object instances between libraries and applications written using any .NET language which conforms to the laid down specifications of data type.
Simplified deployment – The .NET Framework manages the installation of software application developed in .Net framework without interfering with previously installed software and also conforming to security requirements.
Security – The design addresses some of the vulnerabilities, such as buffer overflows, which have been exploited by malicious software. Additionally, .NET provides a common security model for all applications.
Common Language Runtime(CLR)
It manages the execution of .NET programs written in any of the programming languages supported by the .Net framework, thus, enabling sharing of common object-oriented classes.
The runtime uses the metadata of program (usually description of types, members, and references in code) to locate and load classes, lay out memory instances, resolve method invocations and it’s sequencing, generate native code, enforce security, and set run-time context boundaries.
Metadata is stored with the code. Objects whose execution and it’s life is managed by the runtime are called managed data.
The compiled code is converted into machine instructions by Just-in-time compilation in which instructions are executed by the computer’s CPU. CLR also implements the Common Language Infrastructure (CLI) standard which is the basis for creation of execution and development environments for seamless working of languages and libraries together..
The components of CLR includes
- Class Loader: This loads classes into the runtime.
- MSIL to native code compiler: This converts MSIL code into native code.
- Code manager: This manager the code during execution i.e provides code check, the resources it needs during execution.
- Garbage Collector: provide automatic memory management and avoid memory leaks.
- Security Engine: This enforces security restrictions and CAS.
- Type Checker: This enforces strict type checking.
- Thread Support: This provides multithreading support to applications.
- Exception Manager : This provides a mechanism to handle the run-time exceptions.
- Debug Engine : Allow you to debug different type of applications.
- COM marshaler : This allows .net application to exchange data with COM applications.
- BASE Class library : This provides the types the applications needed at runtime.
.NET Framework Platform Architecture
Software programming source code which if written in C# or .Net framework supported programming language, is compiled into an intermediate language (IL) which conforms to the CLI specification. The IL code, along with resources such as bitmaps and strings, is stored as an executable file called an assembly, typically with an extension of .exe or .dll. An assembly contains a manifest that provides information on the assembly’s types, version, culture, and security requirements. It is illustrated below
After the execution of the C# program, the assembly is loaded into the CLR, which may take actions as listed in the manifest. Then, if the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code into native machine instructions of the computer architecture on which the program is to be executed 9usually x86).
Automatic garbage collection, exception handling, and resource management are also the responsibility of the CLR.
As IL code is given by the C# compiler which conforms to the Common Type Specification (CTS), IL code generated from C# can interact with code that was generated from the .NET versions of Visual Basic, Visual C++, Visual J#, or any of more than 20 other CTS-compliant languages. A single assembly may contain multiple modules written in different .NET languages, and the types can reference each other just as if they were written in the same language.
The .NET Framework includes an extensive library of over 4000 classes organized as per the namespaces which provide useful functionality usually covering file input and output to string manipulation and Windows Forms controls.
Apply for C Sharp Certification Now!!
https://www.vskills.in/certification/Certified-C-sharp-Professional