Microsoft .NET Framework is Microsoft’s original implementation of .NET: a runtime and class library for building and running desktop applications, websites and services on Windows. It runs only on Windows and ships as part of the operating system. Any program built on it needs the framework present to start. Developers use it, usually from Visual Studio, to write those programs. It is free, including for commercial use.
Runtime and class library
The .NET Framework has two parts. The common language runtime (CLR) is the execution engine that loads a program and manages it while it runs. The class library is a large collection of reusable, object-oriented types that programs build on instead of writing common functionality from scratch.
Code that targets the CLR is called managed code; the runtime handles its memory, threads, code execution and safety verification. Code outside the runtime, such as a traditional native DLL, is unmanaged code. The .NET Framework lets the two work together in one application.
The class library covers routine work such as string management, collections, database connections and file access. Data access goes through ADO.NET, Language Integrated Query (LINQ) and XML classes. Library types follow shared interfaces, so a developer’s own collection class or a third-party component works alongside the built-in ones.
From source code to running program
Developers write .NET Framework applications in C#, Visual Basic, F# or C++/CLI. Other vendors’ compilers can target the runtime by following the Common Language Infrastructure specification. Every compiler produces Common Intermediate Language (CIL), packaged in assemblies with the .dll or .exe extension.
At run time, the CLR’s just-in-time compiler turns that intermediate code into native machine code for the processor in use. Managed code is therefore never interpreted. Every language compiles to the same intermediate form and shares a common type system. This lets code written in C# use a class written in Visual Basic directly.
Several runtime services remove whole categories of programming errors:
- Garbage collection: the runtime lays out objects, tracks references and frees objects that are no longer used, preventing memory leaks and invalid memory references.
- Type safety: managed code is self-describing, and the runtime verifies that it uses types correctly.
- Trust levels: components can receive different degrees of trust depending on whether they came from the internet, a company network or the local computer. As a result, one component may be blocked from file or registry access inside an otherwise trusted application.
Application types on Windows
The .NET Framework includes programming models for the main kinds of Windows software:
- Windows Forms and Windows Presentation Foundation (WPF) for desktop applications with graphical interfaces.
- ASP.NET for server-side web applications, including Web Forms pages and XML web services.
- Windows Communication Foundation (WCF) for secure, reliable service-oriented applications.
- Windows Workflow Foundation (WF) for applications whose logic runs as workflows.
- Windows services that run in the background and can be started, stopped and controlled by the system.
- Console applications for command-line tools.
ASP.NET hosts the runtime to execute web code on the server. Internet Information Services (IIS) and Microsoft SQL Server can also host it. This lets developers write business logic inside those servers in managed code.
Working with existing native code
Managed code in the .NET Framework can call COM components and ordinary DLLs. This lets an application adopt the framework without rewriting every native dependency. The reverse also works: a native program can load the CLR into its own process and start running managed code. This combines both kinds of components in one application.
Configuration without recompiling
.NET Framework applications read settings from XML configuration files, so administrators can change behavior without rebuilding the program. A machine-wide file holds settings shared by every application on the computer, such as assembly binding rules and ASP.NET defaults. Each desktop program also has its own file named after the executable, for example myApp.exe.config. Visual Studio generates this file from the project’s App.config. These files decide which version of a shared assembly a program loads, where remote objects are located and which application values the code can read.
How releases coexist on a PC
As a Windows component, the .NET Framework receives machine-wide updates through Windows Update. Security and reliability fixes are usually released quarterly and serviced separately from Windows feature updates. On current versions of Windows it cannot be uninstalled on its own.
Releases fall into two generations built on different versions of the runtime. Within the current generation only one release is present at a time. A newer release replaces the older one in place, and programs built for earlier releases of that generation keep running on it.
The older generation serves programs written for the framework’s first releases and installs side by side with the current one. When such a program starts on a computer without it, Windows may prompt to download the feature. It can also be switched on in Windows Features or, on Windows Server, through the Add Roles and Features Wizard. The newest Windows 11 builds offer it only as a standalone installer. This generation is supported for running existing programs, not for developing new ones.
Developers who need to build for a specific release of the current generation install its developer pack, which lets Visual Studio target that release.
.NET Framework compared with modern .NET
Microsoft also develops .NET, the cross-platform successor previously called .NET Core. Both share languages and core concepts, and .NET Standard defines a common set of APIs so one library can work on either. The differences decide which one a project uses:
| .NET Framework | .NET | |
|---|---|---|
| Operating systems | Windows only | Windows, Linux and macOS |
| Delivery | Included with Windows, updated by Windows Update | Ships independently of the operating system |
| Source code | Source available, no outside contributions | Open source, accepts community contributions |
| New features | Security and reliability fixes | All new development |
Microsoft recommends .NET for new projects. Existing .NET Framework applications do not require migration. Microsoft has no plans to remove the .NET Framework from Windows. This means the Windows Forms, WPF, ASP.NET and WCF software built on it keeps running.






