Net Framework (pronounced as a dot net) is a product of Microsoft. It is a programming framework used by Software applications in order to run. It has two major parts: the Common Language Runtime (CLR) and the . Net Framework Class Library.
The CLR is an execution engine used to handle running programs..NET Core is the latest general purpose development platform maintained by Microsoft.
It works across different platforms and has been redesigned in a way that makes .NET fast, flexible and modern. .NET Core happens to be one of the major contributions by Microsoft.
Developers can now build Android, iOS, Linux, Mac, and Windows applications with .NET, all in Open Source.
The .Net framework is a software development platform developed by Microsoft.
The framework was meant to create applications, which would run on the Windows Platform.
The first version of the .Net framework was released in the year 2002.
The version was called .Net framework 1.0. The .Net framework has come a long way since then, and the current version is 4.7.1.
The .Net framework can be used to create both - Form-based and Web-based applications.
web services can also be developed using the .Net framework.
The framework also supports various programming languages such as Visual Basic and C#. So developers can choose and select the language to develop the required application.
In Other Word
.NET is a framework to develop software applications. It is designed and developed by Microsoft and the first beta version released in 2000.
It is used to develop applications for web, Windows, phone. Moreover, it provides a broad range of functionalities and support.
This framework contains a large number of class libraries known as Framework Class Library (FCL). The software programs written in .NET are executed in the execution environment, which is called CLR (Common Language Runtime).
These are the core and essential parts of the .NET framework.
The .Net Framework supports more than 60 programming languages such as C#, F#, VB.NET, J#, VC++, JScript.NET, APL, COBOL, Perl, Oberon, ML, Pascal, Eiffel, Smalltalk, Python, Cobra, ADA, etc.
This framework provides various services like memory management, networking, security, memory management, and type-safety.
The .NET Framework has four main components:
Common Language Runtime (CLR)
Framework Class Library (FCL),
Core Languages (WinForms, ASP.NET, and ADO.NET), and
It acts as an interface between the framework and operating system.
It does exception handling, memory management, and garbage collection.
it provides security, type-safety, interoperability, and portablility.
CLR is the basic and Virtual Machine component of the .net framework It is the run-time enviornment in the .NET Framework that runs the codes and helps in making the development process easier by providing the various services.CLR implements the VES(Virtual Execution System) which is defined in the Microsoft’s implementation of the CLI(Common Language Infrastructure). The code that runs under the Common Language Runtime is termed as the Managed Code. In other words, you can say that CLR provides a managed execution enviornment for the .NET programs by improving the security, including the cross language integration and a rich set of class libraries etc. CLR is present in every .NET framework verison.
CLR version in .NET framework.
.NET FRAMEWORK VERSIONS
4.5(also 4.5.1 & 4.5.2)
4.6(also 4.6.1 & 4.6.2)
4.7(also 4.7.1 & 4.7.2)
Here, the runtime is actually CLR.
Role of CLR in the execution of a C# program
Suppose you have written a C# program and save it in a file which is known as the Source Code.
Language specific compiler compiles the source code into the MSIL(Microsoft Intermediate Language) which is also know as the CIL(Common Intermediate Language) or IL(Intermediate Language) along with its metadata. Metadata includes the all the types, actual implementation of each function of the program. MSIL is machine independent code.
Now CLR comes into existence. CLR provides the services and runtime environment to the MSIL code. Internally CLR includes the JIT(Just-In-Time) compiler which converts the MSIL code to machine code which further executed by CPU. CLR also uses the .NET Framework class libraries. Metadata provides information about the programming language, environment, version, and class libraries to the CLR by which CLR handles the MSIL code. As CLR is common so it allows an instance of a class that written in a different language to call a method of the class which written in another language.
Main Components of CLR
CLR provides a common runtime or execution environment as there are more than 60 .NET programming languages.
Main componenets of CLR:
Common Language Specification (CLS)
Common Type System (CTS)
Garbage Collection (GC)
Just In – Time Compiler (JIT)
Common Language Specification (CLS): It is responsible for converting the different .NET programming language syntactical rules and regulations into CLR understandable format. Basically, it provides the Language Interoperability. Language Interoperability means to provide the execution support to other programming languages also in .NET framework.
Language Interoperability can be achieved in two ways :
Managed Code: The MSIL code which is managed by the CLR is known as the Managed Code. For managed code CLR provides three .NET facilities:
CAS(Code Access Security)
Automatic Memory Management.
Unmanaged Code: Before .NET development the programming language like .COM Components & Win32 API do not generate the MSIL code. So these are not managed by CLR rather managed by Operating System which is called unmanaged code.
Common Type System (CTS): Every programming language has its own data type system, so CTS is responsible for the understanding all the data type system of .NET programming languages and converting them into CLR understandable format which will be a common format.
There are 2 Types of CTS that every .NET programming language have :
Value Types: Value Types will directly store the value directly into the memory location. These types work with stack mechanism only. CLR allots memory for these at Compile Time.
Reference Types: Reference Types will contain a memory address of value because the reference types won’t store the variable value directly in memory. These types work with Heap mechanism. CLR allots memory for these at Runtime.
Garbage Collector: It is used to provide the Automatic Memory Management feature. Suppose if there is no garbage collector then programmers have to write the memory management codes which will be a kind of overhead on programmers.
JIT(Just In Time Compiler): It is responsible for converting the CIL(Common Intermediate Language ) into machine code or native code using the Common Language Runtime environment.
Benefits of CLR:
It improves the performance by providing a richly interact between programs at the run time.
Enhance portability by removing the need of recompiling a program on any operating system that supports it.
Security also increases as it analyzes the MSIL instructions whether they are safe or unsafe. Also, the use of delegates in place of function pointers enhance the type safety and security.
Support automatic memory management with the help of Garbage Collector.
Provides cross-language integration because CTS inside CLR provides a common standard that activates the different languages to extend and share each other’s libraries.
Provides support to use the components that developed in other .NET programming languages.
Provide language, platform, and architecture independency.
It allows the creation of the scalable and multithreaded applications in an easier way as a developer has no need to think about the memory management and security issues.
FCL (Framework Class Library)
It is a standard library that is a collection of thousands of classes and used to build an application. The BCL (Base Class Library) is the core of the FCL and provides basic functionalities.
Windows Forms is a smart client technology for the .NET Framework, a set of managed libraries that simplify common application tasks such as reading and writing to the file system.
ASP.NET is a web framework designed and developed by Microsoft.
It is used to develop websites, web applications, and web services.
It was first released in January 2002.
ADO.NET is a module of .Net Framework, which is used to establish a connection between application and data sources.
Data sources can be such as SQL Server and XML. ADO .NET consists of classes that can be used to connect, retrieve, insert, and delete data.
WPF (Windows Presentation Foundation)
Windows Presentation Foundation (WPF) is a graphical subsystem by Microsoft for rendering user interfaces in Windows-based applications.
WPF, previously known as "Avalon", was initially released as part of .NET Framework 3.0 in 2006. WPF uses DirectX.
WCF (Windows Communication Foundation)
It is a framework for building service-oriented applications.
Using WCF, you can send data as asynchronous messages from one service endpoint to another.
WF (Workflow Foundation)
Windows Workflow Foundation (WF) is a Microsoft technology that provides an API, an in-process workflow engine, and a rehostable designer to implement long-running processes as workflows within .NET applications.
LINQ (Language Integrated Query)
It is a query language, introduced in .NET 3.5 framework.
It is used to make the query for data sources with C# or Visual Basics programming languages.