.NET Overview
Explore the fundamental components and architecture of the .NET platform including the common language runtime, base class library, and compilation process. Understand how .NET supports cross-platform development and the evolution from .NET Framework to today's unified .NET 10.
.NET has evolved from a proprietary Windows platform into a modern, open-source framework for building cross-platform applications. Whether we want to build web services, mobile applications, or desktop software, .NET 10 provides a unified set of tools for various workloads. We must understand the foundational concepts of the ecosystem before we discuss specific implementation details.
What is .NET?
.NET is not a programming language. It is an ecosystem that provides developers with the tools, languages, libraries, and runtimes required to build software for multiple operating systems and devices.
The .NET ecosystem
As with any ecosystem, .NET contains many interrelated components. We can visualize them through the standard order of operations in .NET application development.
The base class library (BCL)
To streamline development, .NET includes an extensive collection of reusable types known as the base class library (BCL).
The BCL handles common tasks such as text management, mathematical calculations, and file I/O operations.
It provides a standard foundation that all .NET languages share to ensure consistency across different project types.
By using the BCL, we avoid writing low-level features from scratch and can focus on our application logic.
Conceptualize different parts of .NET
The development process begins with a language from the .NET family, such as C#, F#, or Visual Basic. We focus on C# because it is the most popular language in the ecosystem, and C# development is often synonymous with .NET development.
Once we write our code, a compiler translates it into common intermediate language (CIL), which is often referred to as IL code. Every .NET language compiles into this same intermediate format. For example, a program written in C# and the same program written in F# will result in nearly identical IL code.
The .NET runtime, known as the common language runtime (CLR), processes this IL code. Specific CLR implementations exist for different operating systems, but they all adhere to the same IL specification. The CLR performs just-in-time (JIT) compilation, which translates the IL into native machine code while the program is executing.
While JIT compilation is the standard for most applications, modern .NET 10 also supports ahead-of-time (AOT) compilation. AOT translates code directly into native machine code before the program runs. This model is frequently used for iOS and cloud-native services where rapid startup performance is a primary requirement.
Note: These technical terms will become more familiar as we move into practical coding.
.NET Framework, .NET Core, and .NET
The platform has undergone a significant evolution to reach its current state:
.NET Framework: The original version was a Windows-only platform for software creation.
.NET Core: Microsoft later introduced this open-source, cross-platform version to allow developers to run applications on Linux and macOS.
.NET: Modern versions have converged into a single, unified system simply called .NET.
Today, .NET 10 is a unified platform that runs natively on Windows, Linux, and macOS.