Modern .NET — Hosting, Configuration, DI & Deployment
What it is & where it is used
.NET is Microsoft's free, open-source, cross-platform developer platform. Today ".NET" (5, 6, 7, 8, 9, 10…) means the unified, cross-platform successor of .NET Core. The older .NET Framework (1.0–4.8.1) is Windows-only and in maintenance mode.
| .NET Framework | .NET Core / modern .NET | |
|---|---|---|
| Platforms | Windows only | Windows, Linux, macOS |
| Open source | Reference source only | Fully open source (github.com/dotnet) |
| Latest | 4.8.1 (2022), maintenance only | .NET 10 (Nov 2025, LTS) |
| Web | ASP.NET (System.Web), Web Forms, MVC 5, Web API 2, WCF server | ASP.NET Core (MVC, Razor Pages, Web API, Minimal APIs, Blazor, SignalR, gRPC) |
| Deployment | Machine-wide install | Side-by-side, self-contained, single-file, containers, Native AOT |
| Performance | Good | Much faster (Span, tiered JIT, PGO) |
Building blocks: runtime (CLR, GC, JIT), libraries (BCL), SDK (compilers, dotnet CLI, MSBuild), ASP.NET Core and Windows Desktop runtimes.
Versions & history
| Version | Released | Type | Notes / support end |
|---|---|---|---|
| .NET Framework 1.0 | 2002 | — | First release with C# 1.0 |
| .NET Framework 2.0 / 3.5 | 2005 / 2007 | — | Generics; LINQ, WCF, WPF (3.0) |
| .NET Framework 4.0 → 4.8.1 | 2010 → 2022 | — | TPL, async (4.5); 4.8.1 is the last version, supported with Windows |
| .NET Core 1.0 | Jun 2016 | — | Cross-platform rewrite |
| .NET Core 2.1 / 3.1 | 2018 / 2019 | LTS | 3.1 added WPF/WinForms on Windows; 3.1 ended Dec 2022 |
| .NET 5 | Nov 2020 | STS | "Core" dropped from the name; one .NET |
| .NET 6 | Nov 2021 | LTS | Minimal APIs, hot reload, MAUI (later); ended Nov 2024 |
| .NET 7 | Nov 2022 | STS | Rate limiting, output caching; ended May 2024 |
| .NET 8 | Nov 2023 | LTS | Native AOT for ASP.NET Core, keyed DI, Blazor full-stack; support ends 10 Nov 2026 |
| .NET 9 | Nov 2024 | STS | HybridCache, Lock type, OpenAPI built in; STS support was extended to 24 months, so it also ends 10 Nov 2026 |
| .NET 10 | Nov 2025 | LTS | C# 14, supported until Nov 2028 |
Release cadence: a new major version every November. Even numbers are LTS (3 years of support); odd numbers are STS (24 months since .NET 9; previously 18). Monthly patch releases ("Patch Tuesday").
Lifecycle
Application startup lifecycle (generic host / ASP.NET Core):
Main/ top-level statements run.WebApplication.CreateBuilder(args)(orHost.CreateApplicationBuilder) creates the host builder: loads configuration (appsettings.json → appsettings.{Environment}.json → user secrets in Development → environment variables → command line), sets up logging and the DI container.- You register services:
builder.Services.Add.... builder.Build()builds the service provider and the app.- You configure the middleware pipeline (
app.Use...) and endpoints. app.Run()starts the host:IHostedService.StartAsyncfor each hosted service, then Kestrel listens.- Requests are processed through middleware → endpoint.
- On shutdown (Ctrl+C / SIGTERM):
IHostApplicationLifetime.ApplicationStoppingfires, hosted servicesStopAsync, the container disposes singletons.
Build/compile lifecycle: source → Roslyn → IL assembly (.dll) + metadata + PDB → (publish) → at runtime JIT → native code. With Native AOT, IL is compiled to a native executable at publish time (no JIT, fast startup, smaller memory, but no runtime code generation and limited reflection).
Support lifecycle: Preview → RC (go-live) → GA (November) → patches → end of support (LTS 3 years, STS 2 years).
Tools used to develop
| Tool | Purpose |
|---|---|
dotnet CLI | new, build, run, test, publish, add package, tool install, --info |
| Visual Studio 2022/2026, VS Code + C# Dev Kit, Rider | IDEs |
MSBuild / .csproj (SDK-style) | Build system |
| NuGet / nuget.org, Azure Artifacts | Packages and private feeds |
global.json | Pin SDK version |
Directory.Build.props, Directory.Packages.props | Shared build settings, central package management |
| dotnet-counters, dotnet-trace, dotnet-dump, dotnet-gcdump | Runtime diagnostics |
| PerfView, Visual Studio profiler | Performance analysis |
| .NET Upgrade Assistant / GitHub Copilot app modernization | Migrate .NET Framework → modern .NET |
| ILSpy, dotPeek | Decompile assemblies |