Skip to content

Introduction to .NET Framework

The .NET Framework is a software platform from Microsoft, built into Windows, for building and running applications. It consists of a virtual execution system called the Common Language Runtime (CLR) and a large set of class libraries that support the execution of applications written in different programming languages such as C#, VB.NET and F#.

Think of the .NET Framework as a fully equipped kitchen. The CLR is the chef who actually cooks (runs your program), and the class library is the shelf of ready-made ingredients and tools (file access, databases, networking, collections). You bring the recipe (your code); you don't have to build the stove or grow the vegetables yourself.

What the .NET Framework provides

  • Language interoperability: the .NET Framework bridges the gap between applications written in different languages. A class written in VB.NET can be used from C#, because both are compiled to the same intermediate language.
  • A rich class library: it contains thousands of ready-made classes, interfaces and value types that speed up development and give easy access to system functionality such as files, networking, databases and security.
  • A managed runtime: the CLR provides memory management, exception handling, debugging, security, thread management, code execution, type safety, code verification and compilation.
  • Automatic memory management: the CLR's garbage collector automatically frees memory that is no longer in use. This prevents most memory leaks and invalid memory references that are common in languages like C and C++.
  • Easy deployment: applications are deployed as assemblies (.exe and .dll files) that describe themselves, so in most cases no registry entries are needed to store information about components and applications. Many applications can be installed simply by copying their folder.

.NET Framework architecture

The .NET Framework is built in layers. Your application sits on top, uses the class library, and runs inside the CLR, which talks to Windows:

Your applications (C#, VB.NET, F#) ASP.NETweb apps Windows Formsdesktop WPFdesktop WCF / WFservices ADO.NET, Entity Framework, LINQ, XML Base Class Library: collections, IO, networking, security, threading Common Language Runtime (CLR) JIT compiler · garbage collector · type system (CTS) · security · exceptions · threads Windows operating system Your code Application models Data access Class library Runtime Operating system
The layers of the .NET Framework: each layer uses the one below it.

How a .NET program runs

  1. You write code in C# (or VB.NET, F#).
  2. The language compiler (for example csc for C#) compiles it into Intermediate Language (IL) and stores it in an assembly (.exe or .dll) together with metadata.
  3. When the program starts, the CLR loads the assembly, verifies it, and its JIT (Just-In-Time) compiler converts the IL into native machine code for the computer's processor.
  4. The native code runs under the control of the CLR, which manages memory, security and exceptions.
C# source code  --(C# compiler)-->  IL in .exe/.dll  --(JIT)-->  native code
Program.cs                          MyApp.exe                    x86 / x64 / ARM64

Because every .NET language compiles to the same IL and follows the same type rules, code written in different languages can work together.

Components of .NET Framework

The .NET Framework has many components. They can be grouped as follows:

GroupComponentWhat it does
RuntimeCommon Language Runtime (CLR)Runs .NET code: JIT compilation, memory management, security, exceptions
Common Type System (CTS)Defines the data types all .NET languages share
Common Language Specification (CLS)Rules that languages follow so their code can be used from other .NET languages
LibrariesFramework Class Library (FCL), including the Base Class Library (BCL)Ready-made classes for collections, files, networking, security, threading and more
Application modelsWindows FormsDesktop applications with forms and controls
Windows Presentation Foundation (WPF)Rich desktop user interfaces with XAML
ASP.NET (Web Forms, MVC, Web API) and ASP.NET AJAXWeb applications and web services
Console applicationsCommand-line programs
Data accessADO.NET (ActiveX Data Objects for .NET)Connecting to databases and running SQL
Entity Framework and WCF Data ServicesObject-relational mapping and data services
Language Integrated Query (LINQ)Querying collections, databases and XML with C# syntax
ServicesWindows Communication Foundation (WCF)Building service-oriented applications (SOAP and other protocols)
Windows Workflow Foundation (WF)Building workflow-based applications
LanguagesC#, VB.NET, F# and C++/CLI compilersCompile source code into IL

Benefits of .NET Framework

  • Consistent programming model: the same classes and patterns are used for desktop, web and service applications.
  • Language interoperability: components written in different .NET languages work together.
  • Automatic management of resources: garbage collection frees memory automatically.
  • Ease of deployment: self-describing assemblies, side-by-side versions and simple copy-based installation.
  • Security: type safety, code verification and built-in security libraries.
  • Runs on all supported versions of Windows: one application works on desktop and server editions of Windows. (For Linux and macOS, use modern .NET.)

.NET Framework 4.0 also added several features developers still use every day:

  • Support for dynamic data types (dynamic)
  • Named and optional arguments
  • Easier access to Office interop objects
  • An improved integrated debugger in Visual Studio 2010

Evolution of .NET Framework

VersionReleasedVisual StudioHighlights
1.013 February 2002Visual Studio .NET 2002First release: CLR, class library, ASP.NET Web Forms, Windows Forms, ADO.NET
1.12003Visual Studio .NET 2003ASP.NET mobile controls, ODBC and Oracle data providers
2.02005Visual Studio 2005Generics, nullable types, partial classes, anonymous methods
3.02006Visual Studio 2005 (with extensions); shipped with Windows VistaWPF, WCF and Windows Workflow Foundation
3.52007Visual Studio 2008LINQ, lambda expressions, ASP.NET AJAX
4.02010Visual Studio 2010dynamic, named and optional arguments, Task Parallel Library
4.52012Visual Studio 2012async and await
4.62015Visual Studio 2015New 64-bit JIT compiler (RyuJIT)
4.72017Visual Studio 2017High-DPI and accessibility improvements
4.82019Visual Studio 2019Performance and security updates
4.8.12022Visual Studio 2022Native ARM64 support; the final version of .NET Framework

.NET Framework 4.8.1 is still supported as part of Windows, but no new features are added to it. New applications are built on the modern, cross-platform .NET (formerly .NET Core). See .NET Framework vs .NET Core for the differences.

Interview questions

1. What is the .NET Framework?

A Windows platform from Microsoft for building and running applications. It consists of the Common Language Runtime (CLR), which executes code, and the Framework Class Library, which provides ready-made functionality.

2. What are the main components of the .NET Framework?

The CLR, the Framework Class Library (including the Base Class Library), the Common Type System, the Common Language Specification, and application models such as ASP.NET, Windows Forms, WPF, WCF and ADO.NET.

3. How does language interoperability work in .NET?

All .NET languages compile to the same Intermediate Language and follow the Common Type System, so a class written in one language can be used, and even inherited, from another.

4. What is the latest version of the .NET Framework?

.NET Framework 4.8.1, released in 2022. It is the final version; new development happens in modern .NET.

Summary

  • The .NET Framework is Microsoft's Windows platform for building and running applications.
  • It consists of the CLR (the runtime) and a large class library.
  • Code is compiled to IL, then turned into native code by the CLR's JIT compiler.
  • It provides language interoperability, automatic memory management and easy deployment.
  • Versions run from 1.0 (2002) to 4.8.1 (2022), the final version.