.NET Framework was developed by Microsoft in the year 2002 and runs mainly on Windows
operating systems. NET Framework is a massive collection of libraries of classes and functions to ease the
development process of coding Windows and Web applications.
These classes run on top of the CLR (Common Language Runtime).
The main core features are the Framework Class Library (FCL) and CLR (Common Language Runtime). It does memory management, networking, security, memory management, and type-safety.
The .NET Framework is composed of four main components:
1. Common Language Runtime (CLR)
2. Framework Class Library (FCL),
3. Application Types (WinForms, ASP.NET, and ADO.NET), and
4. Other Modules (WCF, WPF, WF, Card Space, LINQ, Entity Framework, Parallel LINQ,
Task Parallel Library, etc.)
CLR (Common Language Runtime)
.NET Framework uses the CLR to execute the program. It converts the program code to native
code. It provides security, type-safety, interoperability, and portability.
The " Common Language Infrastructure" or CLI is a platform on which the .Net programs are
executed.
The CLI has the following key features:
- Exception Handling - Exceptions are errors that occur when the application is executed.
Eg: If the application tries to get data from the database but the database connection is not valid.
- Garbage Collection - Garbage collection is the process of removing unwanted resources when they are no longer required.
Eg: The database connection is no longer needed after all the database operations finished.
Program Execution:
The compile and execution take place in 2 steps:
- The specific .NET compiler converts the source .NET code into CIL (Common Intermediate Language) (previously known as MSIL - Microsoft Intermediate Language).
- Then the CLR compiles the CIL into native machine code.
- The figure below shows the flow of compilation and execution of a .NET program.
FCL (Framework Class Library)
It is a standard library consisting of a collection of thousands of classes and used to build an application. It has various classes, data types, interfaces, etc. to perform many functions and make different types of applications such as desktop applications, web applications, mobile applications, etc.
The FCL is integrated with the Common Language Runtime (CLR) of the .NET framework and is used by all the .NET languages such as C#, F#, Visual Basic .NET, etc.
The BCL (Base Class Library) is the main thing of the FCL and provides basic functionalities.