.NET Concepts
.NET platform and application architecture concepts explained in depth, one at a time.
Runtime & SDK
The .NET Support Lifecycle and Choosing a Target
LTS versus STS, active and maintenance phases, SDK versus runtime versions, global.json with rollForward, how the host picks a runtime, and what to target in late 2026.
From Source to Machine Code: Roslyn, IL and the JIT
What Roslyn writes into an assembly (IL and metadata), reading IL with ILSpy, tiered JIT with dynamic PGO and OSR measured on .NET 10, and what ReadyToRun changes.
File-Based Apps: Running a Single .cs File (.NET 10)
dotnet run app.cs with the #:package, #:sdk and #:property directives, the virtual project and its cache, the Native AOT default that breaks Dapper and EF Core under dotnet run, shebangs, publish and dotnet project convert.
Porting from .NET Framework to Modern .NET
What no longer exists and how loudly each gap fails (compile error, warning or only at run time), NU1701, netstandard2.0 and multi-targeting as the bridge, the CA1416 analyzer, porting order and the current status of the official tools.
Project System
SDK-Style Projects, MSBuild and Directory.Build.props
What Sdk="Microsoft.NET.Sdk" imports, implicit globbing and how to inspect it (-getItem, -pp, binlog), Directory.Build.props versus .targets and their evaluation-order traps, .slnx and ArtifactsPath, all measured on SDK 10.0.100.
Assemblies, Frameworks and How the Host Resolves Them
Assembly identity, reference versus implementation assemblies, real deps.json and runtimeconfig.json, the host trace (DOTNET_ROOT, roll-forward), why a DLL in the folder is not found, [TypeForwardedTo] and AssemblyLoadContext isolation.
The dotnet CLI and the Noun-First Commands
CLI anatomy, the .NET 10 noun-first commands (and a reference add failure seen on SDK 10.0.100), -p: and where it breaks, tool manifests, dotnet tool exec and dnx, dotnet watch hot reload, --cli-schema and .slnf solution filters in dotnet sln (.NET 11), measured on SDKs 10.0.100 and 11.0.100.
Analyzers, EditorConfig and Build Quality Gates
CA and IDE rules and when each runs in dotnet build, AnalysisMode and AnalysisLevel with measured warning counts (and the latest trap on SDK 10.0.100), severity and precedence in .editorconfig and .globalconfig, TreatWarningsAsErrors and its siblings including the NuGet audit effect, suppressions and the trace they leave, nullable as a gate, third-party analyzers with PrivateAssets, and dotnet format in CI.
MSBuild Custom Targets, Tasks and Binary Logs
The two MSBuild phases and why a property read in the wrong place is empty, targets with BeforeTargets, AfterTargets and DependsOnTargets, Inputs and Outputs with measured timings, items with batching and transforms, Exec, Warning and Error, Directory.Build.targets, inline and compiled tasks (PrivateAssets, TaskHostFactory) and diagnosis with a binlog read from code, PerformanceSummary and -check, plus what the .NET 11 SDK changed.
NuGet & Packaging
NuGet Restore, Versions and Dependency Resolution
Version notation, the restore resolution rules (lowest applicable version, direct dependency wins), floating versions and lock files, NuGetAudit, and what changed in restore in .NET 9 and .NET 10.
Central Package Management and Package Source Mapping
Centralize versions in Directory.Packages.props (VersionOverride, transitive pinning, global references) and map package IDs to feeds in nuget.config to stop dependency confusion, with the real errors and the limits of each.
Packaging and Publishing a NuGet Library
How dotnet pack turns a project into a package (metadata, readme, symbols, Source Link), the SemVer and VersionSuffix rules, package validation catching a CP0002 breaking change, testing the package from a local feed, and what pushing to nuget.org or a private feed means.
Multi-Targeting and .NET Standard
What TargetFrameworks produces in a package, how NuGet picks the assembly for a net8.0 or net10.0 consumer, #if symbols, polyfills such as IsExternalInit, what netstandard2.0 is still for, and which C# features survive on an old target.
NuGet Supply Chain: Audit, Lock Files and Minimum Publish Age
Defense in depth for NuGet with real output from the 11.0.100 SDK: NuGetAudit modes and levels, packages.lock.json with --locked-mode (NU1004 versus NU1403), transitive pinning, package signatures and the new minimum publish age (minPublishAgeHours, NU1020).
CI/CD for .NET: GitHub Actions, SBOM, SourceLink and Signing
A build, test and publish pipeline measured on a toy library: locked restore with and without cache, coverlet, ReportGenerator and MTP coverage with a failing gate, deterministic builds (what changes the hash), SourceLink read from the PDB, MinVer versions from tags, NuGetAudit on a real vulnerable package, CycloneDX and SPDX SBOMs, dotnet nuget sign with a test certificate, push with --skip-duplicate, and trusted publishing, attestations and pipeline security from the docs.
Publishing & Native AOT
Self-Contained, Single-File and Trimmed Publishing
Framework-dependent versus self-contained, RIDs, single file (IL3000, extracted native libraries, compression), trimming with real IL2026/IL2057/IL2070 warnings and DynamicallyAccessedMembers, feature switches (HTTP/3 off in .NET 10) and the startup surprise between trimming and ReadyToRun, with measured sizes and times.
Native AOT and Its Limits
What PublishAot does (ILC, the native linker, no cross-OS builds), what it buys in startup, memory and size measured on a console app and a minimal API, what breaks and why (Reflection.Emit, dynamic, generics over structs, LoadFrom, interpreted expression trees), the JSON failure that has no warning, and where ASP.NET Core and EF Core stand in .NET 10.
Source Generators and AOT-Friendly Code
How [GeneratedRegex], JsonSerializerContext and [LoggerMessage] replace reflection with compile-time code, how to read the generated files (and the duplicate-definition trap), the IL2026 and IL3050 warnings on the reflection path, and a small IIncrementalGenerator built and run on SDK 10.
Containerizing .NET: SDK Publish, Dockerfile and Chiseled Images
Two routes to a .NET 10 container image, the SDK's PublishContainer (no Dockerfile, no daemon) and a multi-stage Dockerfile, with the inferred base image (Ubuntu 24.04 for 10.0), the rootless user 1654, the image config and layers read from a tar archive, chiseled and Alpine families measured by size, multi-arch images, the LocalRegistry property and reproducible digests with SOURCE_DATE_EPOCH in .NET 11, registry authentication, and what missing ICU does to culture-sensitive code.
Diagnostics
ASP.NET Core Fundamentals
Minimal APIs: Routing and Route Groups
How a URL becomes a handler call (templates and parameter binding), named routes with CreatedAtRoute, route groups, and moving endpoints out of Program.cs.
DTOs and the API Contract
Why a REST API never serializes entities, one DTO per use case with C# records, where the mapping lives, and projecting straight in the query.
REST Semantics: Status Codes and Idempotency
Verb, URI, and status code as the HTTP contract, which methods are safe or idempotent, honest 404s, idempotent DELETE, TypedResults, and ProblemDetails.
Input Validation in Minimal APIs
Data annotations with AddValidation (.NET 10), the 400 response with per-field errors, the trap of types that are never discovered, and what annotations cannot express.
Configuration and the Options Pattern
Configuration sources and their precedence, overriding per environment without touching code, typed settings with ValidateOnStart, and keeping secrets out of the repository.
Dependency Injection and Service Lifetimes
What the container does, transient vs scoped vs singleton, why the DbContext is scoped, captive dependencies, creating a scope by hand, and keyed services.
Hosting & Pipeline
Kestrel, IIS and Hosting Models
Kestrel alone or behind a reverse proxy, forwarded headers and the trusted proxy list, server limits, IIS in-process versus out-of-process, and memory eviction in ASP.NET Core 10.
The Middleware Pipeline and Program.cs
Use, Run and Map, what WebApplication adds automatically, the recommended order, short-circuiting, convention middleware versus IMiddleware, and environments.
HTTPS, HSTS and Secure Defaults
HTTPS redirection and the port it must discover, HSTS defaults and a safe rollout, RedirectHttpResult.IsLocalUrl against open redirects, what APIs should do with plain HTTP, and the development certificate.
Static Files and MapStaticAssets
The build-time manifest, fingerprinting and precompression behind MapStaticAssets, the headers the server sends, what it will not serve, when UseStaticFiles is still needed, and the effect of ShortCircuit.
Choosing an ASP.NET Core Application Model
Minimal APIs, controllers, Razor Pages, MVC, Blazor, gRPC and SPA plus API side by side: what each .NET 10 template really generates, what the shared host gives all of them, and where per-model defaults still differ, measured with real requests.
Response Compression: Brotli, Gzip and Zstandard
The ASP.NET Core response compression middleware, the zstd, br and gzip providers, Vary: Accept-Encoding on every response in .NET 11, HTTPS and BREACH, when to leave compression to the proxy, and size and time measured on a 371 KB payload.
Minimal APIs
Parameter Binding and Endpoint Filters
The order in which a parameter's source is chosen, binding failure codes, AsParameters, custom TryParse and BindAsync, forms with antiforgery, and AddEndpointFilter.
ProblemDetails and Global Exception Handling
The RFC 9457 problem+json document, why AddProblemDetails alone leaves a 404 empty, IExceptionHandler chains, CustomizeProblemDetails, and keeping exception details out of responses.
Route Constraints, Short-Circuit Routes and Handler Results
Route constraints that decide whether a route matches (404 versus 400), regex escaping pitfalls, custom constraints, ShortCircuit and MapShortCircuit, and what each kind of handler return value turns into.
JSON Patch and Partial Updates
PUT versus PATCH, RFC 6902 operations applied to C# objects with the new System.Text.Json package in .NET 10, why a failure halfway does not roll anything back, a safe PATCH endpoint with a DTO and validation, the threats the framework leaves to you, and merge patch as the alternative.
Async Validation with Data Annotations
AsyncValidationAttribute and IAsyncValidatableObject in .NET 11 Minimal APIs for rules that query a database or a service, the order in which rules run, the ProblemDetails response, cancellation through the request token, asynchronous options validation at host startup (IAsyncStartupValidator and IAsyncValidateOptions), and what was left out because it was not executed.
HTTP QUERY: Safe Requests With a Body
The QUERY method (RFC 10008) as a safe and idempotent search with a body: MapMethods and HttpMethod.Query in .NET 11, redirects and retries on HttpClient, why output caching skips it and how to key it by body, the CORS preflight, OpenAPI 3.2 against 3.1, and what was tested against what only the docs claim.
MVC & Razor Pages
MVC Controllers, Filters and Model Binding
Controller-based web APIs in ASP.NET Core 10: what ApiController turns on and how to turn it off, binding sources and precedence, binding failures, over-posting with an entity vs a DTO, the real filter pipeline order, scopes and Order, ServiceFilter vs TypeFilter, exception filters vs middleware, ActionResult of T, a comparison with Minimal APIs and what changed since ASP.NET MVC 5, with the measured result of each experiment.
Razor Pages, Tag Helpers and View Components
Razor Pages in a real net10.0 app, measured request by request: handlers and what BindProperty binds (SupportsGet, unknown handler falling through to OnPost, RedirectToPage reusing ambient route values), Tag Helper HTML compared with HTML Helpers, the antiforgery 400 and where IgnoreAntiforgeryToken is allowed, _ViewImports, layouts and sections failures, a custom Tag Helper with unit and WebApplicationFactory tests, view component rules (no model binding, silent typos) and partial vs view component vs Tag Helper, the jquery-validation-unobtrusive scripts that dotnet new webapp ships on SDK 10.0.100, and what Razor compilation costs (DLL size, startup, first request, runtime compilation now obsolete), with a book vs today note on WebForms, MVC and Blazor.
API Documentation
OpenAPI Document Generation in ASP.NET Core 10
AddOpenApi and MapOpenApi, OpenAPI 3.1 by default in .NET 10, XML comments and Description on Produces attributes, transformers, multiple documents and build-time generation, shown with real generator output.
Scalar, .http Files and Client Generation
Scalar as the reference UI for the OpenAPI document, .http files with variables and environments, and a typed client generated with Kiota, showing that the generated client is only as good as the document.
HTTP Logging and Request Diagnostics
What HTTP logging and W3C logging write by default, which flags log query strings and bodies, per-endpoint and per-request control with an interceptor, and trace-id correlation with LoggerMessage, with real log output.
HTTP Clients
HttpClient and IHttpClientFactory
Socket exhaustion with a client per request, the DNS problem of a static client and PooledConnectionLifetime, named and typed clients, DelegatingHandler, HttpClient.Timeout versus CancellationToken, ResponseHeadersRead and GetFromJsonAsync, and the .NET 11 InitialHttp2MaxConcurrentStreams, with the real result of each experiment.
Resilience: Retries, Timeouts and Circuit Breakers
Microsoft.Extensions.Http.Resilience (Polly v8) on an HttpClient: standard handler defaults, retry with jitter and Retry-After, why retrying a POST is dangerous, attempt versus total timeout, circuit breaker and hedging, with what the server really received.
CORS for SPA and WebAssembly Clients
Which headers the ASP.NET Core CORS middleware sends, what a preflight is, credentials and exposed headers, the configurations that fail silently (trailing slash, any origin with credentials, UseCors after authorization), verified with curl and real browser fetch calls.
Security
Authentication and Authorization Fundamentals
Schemes and handlers, challenge versus forbid, cookie versus bearer and the .NET 10 cookie redirect change, claims, roles and policies, resource-based authorization and pipeline wiring mistakes, with the real 401/403 of each request.
JWT Bearer Tokens and ASP.NET Core Identity
What the JWT bearer handler validates and what it lets through (a 5 minute clock skew), why claims arrive under odd names, the opaque tokens of MapIdentityApi, what refresh, logout and the security stamp really revoke, passkeys in .NET 10, and where a browser should keep tokens.
OpenID Connect, Entra ID and the BFF Pattern
Signing in with OpenID Connect in ASP.NET Core (code flow with PKCE, PAR by default, the cookie as session, SaveTokens, claim mapping, RP-initiated and front-channel logout, Correlation failed and message.State errors behind proxies and replicas), protecting an API with Microsoft.Identity.Web (audience, issuer, scp versus roles, v1 and v2 tokens, downstream calls) and the BFF pattern for SPAs, all observed against a local OpenID provider.
Data Protection: Key Ring and Purposes
The ASP.NET Core Data Protection system behind auth cookies, antiforgery tokens and OIDC state: IDataProtector, the payload format, purposes and isolation, time-limited payloads, the key ring on disk with its dates and rolling, SetApplicationName, EF Core and certificate protection, and two real cookie-auth instances with separate rings, a shared ring and a simulated redeploy, with the measured result of each experiment.
Cryptography: Hashing, HMAC, AES-GCM and Password Hashing
Choosing the .NET primitive by the job, with measurements: SHA256.HashData, why a fast hash is wrong for passwords, PBKDF2 with a random salt, the real format of Identity's PasswordHasher, constant-time comparison, HMAC, signatures, AesGcm tamper detection and nonces, the SYSLIB diagnostics on legacy APIs, RandomNumberGenerator, the .NET 10 post-quantum types and the .NET 11 additions (X25519, AES Key Wrap, HPKE, composite ML-KEM).
CSRF Protection: Antiforgery Tokens and Fetch Metadata
The two CSRF defenses of ASP.NET Core, the antiforgery token and the .NET 11 automatic check by Sec-Fetch-Site and Origin, which one has the final verdict, how to open a webhook or a trusted partner site, what a JSON endpoint does not get and how DisableAntiforgery and DisableCsrfProtection behave, with the status code of each case from tests that send the headers.
Identity & Access
OAuth 2.0 Clients in .NET Code: PKCE, Client Credentials and Device Flow
A .NET app as the OAuth client, written in C# and measured against Keycloak: a client-credentials token handler with a single refresh under 50 concurrent callers (1 token request against 50), one renewal on 401 and where it sits relative to the retry handler, MSAL and Duende.AccessTokenManagement compared with the hand-written version (Duende license read from the vendor pages), private_key_jwt, authorization code with PKCE on a loopback listener, the device flow with slow_down and expiry, refresh rotation and reuse, and where tokens and secrets rest.
Building an Authorization Server with OpenIddict
An OAuth 2.0 and OpenID Connect server in ASP.NET Core with OpenIddict 7.9.0, measured with curl against a SQLite lab and a separate API: the four tables, PKCE and exact redirect_uri errors, claim destinations, encrypted access tokens versus JWT, introspection, revocation and entry validation, refresh rotation and reuse, key rotation, reference tokens, PAR, mTLS and the missing DPoP; and when not to build one, against Duende IdentityServer and ready-made products.
Secrets and Managed Identities: Key Vault and Workload Identity
From the secret ladder (appsettings, user-secrets, environment variables, measured with GetDebugView) to the DefaultAzureCredential chain and why docs say to replace it in production, ManagedIdentityCredential against a fake App Service identity endpoint (token request, cache, retries, 429, timeouts), WorkloadIdentityCredential against a fake token endpoint that validates the client_assertion JWT, and Key Vault through the Lowkey Vault emulator (versions, soft delete, the configuration provider, rotation, vault down). Real Azure parts, Vault/OpenBao and the secrets-in-CI bridge are docs only, and it ends with a table of where a secret lives.
MFA with TOTP and Recovery Codes in ASP.NET Core Identity
The ASP.NET Core Identity second factor measured with the real UserManager and SignInManager (net10.0, EF Core SQLite) and an independent TOTP checked against the 18 RFC 6238 vectors: the key, the otpauth URI and the QR code the framework does not draw, the five-step clock window, reuse of a code inside the window (the default does not stop it) and a provider that does, single-use recovery codes stored in clear text and ProtectPersonalData, lockout shared with the password, the cookies of the two-step sign-in and remember-this-machine, the MapIdentityApi /manage/2fa request and response shapes, a step-up policy with an mfa_at claim that survives security stamp refresh, and what the .NET 10 passkey support is and is not.
Client Certificates, mTLS and API Keys in ASP.NET Core
Service-to-service authentication in ASP.NET Core, measured on Kestrel and openssl with a throwaway test CA: the ClientCertificateMode values over TLS 1.2, TLS 1.3 and HTTP/2 (DelayCertificate renegotiation fails on macOS, throws on Linux TLS 1.3 over HTTP/1.1 and silently returns no certificate over HTTP/2), AddCertificate validation (system versus custom root trust, usage, expiry, revocation by CRL and OCSP failing closed), a certificate forwarded in a header and how to forge it and close it, the client-side certificate APIs, API keys with SHA-256 hashing, constant-time comparison and overlap rotation (203 ns per check, a naive comparison leaks the prefix length), and a certificate-bound token (RFC 8705, cnf x5t#S256).
External Authorization with OpenFGA or OPA in ASP.NET Core
An external PDP (real OpenFGA and OPA in Docker) called from a resource-based AuthorizationHandler and an endpoint filter in ASP.NET Core, measured on .NET 10 with OpenFga.Sdk 0.10.5: latency per call (0.45 ms against 0.15 ms for a built-in handler), the N+1 problem on lists (one Check per item, BatchCheck capped at 50, ListObjects silently capped at 1000), decision caching and the stale decision after a revoke (a 5 s TTL, in both directions, plus OpenFGA's own query cache and HIGHER_CONSISTENCY), OPA bundles and decision logs, and what happens when the PDP is down or hung (fail-open against fail-closed, SDK retries, timeouts).
SAML 2.0 Single Sign-On in ASP.NET Core
SAML 2.0 service provider in ASP.NET Core, measured against a real Keycloak 26.8.2 in Docker with Sustainsys.Saml2.AspNetCore2 2.11.1 on net10.0. ASP.NET Core has no native SAML (shared framework and Microsoft packages checked), and the library state checked on 2026-11-19 (Sustainsys in security-only mode with four advisories fixed in 2.11.1, ITfoxtec active with net10 and net11 targets, Duende IdentityServer 8 SAML docs only). The AuthnRequest over the Redirect and POST bindings, the signed Response and Assertion decoded, SP and IdP metadata, attribute-to-claim mapping and the cookie session (7 role attributes, a 4017 byte chunked cookie, a 500 from ForbidAsync), and the attacks measured: tampered, unsigned and wrongly signed assertions, XML Signature Wrapping (a naive verifier is fooled, the library rejects), Audience, InResponseTo, the default 5 minute clock skew, replay (the cache is in memory and forgets on restart) and Single Logout (SP-initiated works, IdP back-channel logout does not end the app session).
Windows Authentication in .NET: Negotiate, Kerberos and LDAP
Integrated authentication in ASP.NET Core 10 with Microsoft.AspNetCore.Authentication.Negotiate 10.0.15, measured against a real MIT Kerberos KDC and a real OpenLDAP in Docker (SDK 10.0.100, run on Ubuntu 24.04 with runtime 10.0.14). The 401 Negotiate challenge and the mutual-auth token, connection state (Kerberos is not kept per connection by default, NTLM is; PersistKerberosCredentials on and off), HTTP/2 and proxies, and the failures as client and server see them (no ticket, SPN by IP or alias, clock skew of 4 and 6 minutes, keytab without the key, a rotated key version, a missing keytab, all 500 by default and how to turn them into 401). NTLM on Linux needs gss-ntlmssp and a validator, and the user name changes spelling. Roles from EnableLdap on Linux (nested groups, 10 minute cache, MachineAccountName unsupported, no reconnect and a SIGSEGV after an LDAP restart, a 500 for a user without memberOf) and the handler's own LDAP injection fixed in 10.0.10 (CVE-2026-47303 and two more advisories), shown with principals such as bo* on 10.0.9 against 10.0.15. LDAP directly with System.DirectoryServices.Protocols: simple, anonymous and empty-password binds, SASL GSSAPI, LDAPS and StartTLS quirks on Linux, paging against a server-side total limit, and filter escaping (the library has none). System.DirectoryServices.AccountManagement is Windows-only (build and run shown). IIS, HTTP.sys and Kerberos delegation are docs only. Kerberos against OIDC and SAML.
Resilience & Protection
Rate Limiting and Request Timeouts
The ASP.NET Core rate limiting and request timeouts middlewares measured with real bursts: fixed window, sliding window, token bucket and concurrency limiters, the default 503, 429 with Retry-After, queueing latency, global and named policies, partitioning and its DoS risk, the reverse proxy trap, the rate limiting metrics, and what the client sees when a request times out.
OWASP in ASP.NET Core: Security Headers and CSP
The OWASP Top 10:2025 mapped to ASP.NET Core (what the framework does and what stays with you), security headers (CSP with a per-request nonce, nosniff, Referrer-Policy, Permissions-Policy, frame-ancestors), a hand-written middleware against the NetEscapades package, CSP with Blazor and inline scripts, mass assignment with a DTO, and user-secrets in development, all run on .NET 10.
Caching & Performance
Caching: IMemoryCache, HybridCache and Distributed
IMemoryCache is not atomic (stampede), lazy expiration, a SizeLimit that drops silently, IDistributedCache, HybridCache with L1/L2 and one factory run per key, tags, what invalidation does not reach on other servers, and the payload and key limits, with the measured result of each experiment.
Output Caching and HTTP Caching
Caching whole responses three ways, measured with handler counters: HTTP headers and ETag with 304, the Response Caching middleware that a client switches off with one header and that ignores the query string, and Output Caching with policies, cache keys, tags, resource locking, limits and a real leak caused by the wrong middleware order.
Observability
OpenTelemetry: Logs, Metrics and Traces
ILogger, Meter and ActivitySource as the three framework APIs, what ASP.NET Core already emits on its own, what the SDK and the instrumentation packages add, context propagation, metric cardinality limits, histogram buckets, sampling, resources the path the OTLP exporter really posts to and the .NET 11 tracing rules for Activity (AddTracing, no manual ActivityListener), with the measured result of each experiment.
ILogger: Categories, Levels, Filtering and Scopes
ILogger<T> and ILoggerFactory categories, log levels, the rule that picks one filter per provider and category, per-provider sections, AddFilter, EventId, message templates versus interpolation and CA2254, scopes, source-generated [LoggerMessage] logging and redaction of classified data, with the measured result of each experiment.
Structured Logging with Serilog and Log Sinks
Serilog behind ILogger in ASP.NET Core, run on .NET 10: message templates against interpolation, destructuring with masking, UseSerilog and the bootstrap logger, Console JSON and rolling File sinks configured in appsettings, LogContext, scopes and enrichers, request logging, redaction of sensitive data, an in-memory sink for tests, and Serilog against OpenTelemetry Logs.
Observability Backends: Prometheus, Grafana, Tempo and Application Insights
Where OpenTelemetry signals go and how to query them, measured on Docker with two ASP.NET Core services: the Collector as the single endpoint (OTLP over gRPC and HTTP), Prometheus with PromQL and the effect of an exploding tag on series, Tempo traces, Loki logs with trace_id, Grafana datasources provisioned by file and checked through the API, head sampling in the SDK against tail sampling in the Collector, and Application Insights from the docs only.
Operations
Health Checks: Liveness and Readiness
AddHealthChecks and MapHealthChecks, status codes (Degraded is still 200), IHealthCheck with failureStatus and exceptions, tags and Predicate for liveness, readiness and startup, a hanging check with and without a timeout, the EF Core DbContext check with SQLite, the private JSON report, and why dependencies in the liveness probe restart every replica, with the measured result of each experiment.
Feature Flags with Microsoft.FeatureManagement
Feature flags on .NET 10 measured for real: flags in configuration, the percentage, time window and targeting filters, FeatureGate on controllers and Minimal APIs, variants, reload and snapshots, per-flag tests with WebApplicationFactory, the debt of old flags, and what an external flag service adds.
Windows Services and systemd Hosting
UseSystemd and UseWindowsService read from the source, then a real app under systemd 257: Type=notify, journal priorities, crash and restart, graceful shutdown against TimeoutStopSec, port 80 without root, hardening, the watchdog, and the Windows Service side (sc.exe, accounts, recovery, Event Log) from the docs.
Real-Time
Remote APIs
gRPC Services and JSON Transcoding
gRPC in ASP.NET Core 10 with measured results: .proto contracts and generated code, the HTTP/2 requirement (h2c, HTTP_1_1_REQUIRED, 426 on HTTP/1.1), channel reuse, the four call types, deadlines and cancellation, status codes and rich errors, metadata, interceptors, contract evolution, protobuf vs JSON sizes, JSON transcoding and its streaming limits, and when to choose gRPC, REST or transcoding.
Reverse Proxy and API Gateway with YARP
A YARP gateway in front of two real Kestrel backends, measured end to end: routes and clusters, transforms, six load balancing policies, passive and active health checks, rate limiting and authentication at the edge, timeouts and status codes, hot reload, gateway versus BFF, and YARP against managed gateways, Ocelot and Envoy, all run on .NET 10.
GraphQL with Hot Chocolate
A Hot Chocolate 16.7.6 server on net10.0 measured end to end: code-first schema with source generators, the N+1 problem counted in SQL statements with 1, 10 and 100 parents (7, 61 and 601 against a flat 3 with DataLoader), filtering, sorting and projection as SQL, cursor connections against offset on 200,000 rows, subscriptions over WebSocket and SSE, depth and cost limits (and how an unannotated list hides a 51,010 cost behind a 30), introspection, persisted operations, partial errors against HTTP status, authorization, GraphQL against Minimal APIs in bytes and requests, and the project's maintenance state and licensing.
Web API Design
API Versioning with Asp.Versioning
Versioning ASP.NET Core 10 APIs with the Asp.Versioning packages: which package fits Minimal APIs, controllers and OpenAPI, the query string, header, URL segment and media type readers with the exact status codes and problem-details bodies each returned, default versions, version-neutral endpoints, deprecation and sunset headers, OpenAPI documents per version, and a strategy comparison grounded in the measurements.
File Uploads, Streaming Multipart and Range Requests
Uploading and downloading large files in ASP.NET Core 10, measured on Kestrel with 1 MB, 100 MB and 1 GB: what IFormFile really buffers (temp disk, flat memory, 2 GB of disk for a 1 GB upload), streaming with MultipartReader and BodyReader (a 1 GB body at about 110 MB of working set against 2.1 GB when materialized), which limit answers 413, 400, 408 or 500 and when (Kestrel, RequestSizeLimit, IHttpMaxRequestBodySizeFeature, FormOptions, MinRequestBodyDataRate), Expect 100-continue, magic numbers and hostile file names, Range, If-Range and Content-Disposition filename* (multiple ranges ignored, unknown units served as bytes, If-Range skipped without an ETag), a resumable upload with a hand-written tus subset and tusdotnet 2.12.0, and local disk against an S3-compatible store with AWSSDK.S3 presigned URLs.
Cloud-Native
Globalization
Blazor Fundamentals
Blazor Render Modes and Hosting Models
Static SSR, Interactive Server, WebAssembly and Auto, what the server sends for each, the double render of prerendering, and the cost in latency, circuits and download size.
Blazor Static SSR and Enhanced Navigation
Pages rendered on the server without a circuit, enhanced navigation and forms, SupplyParameterFromForm with antiforgery, and streaming rendering, observed on the wire.
Blazor Routing, Layouts and Navigation
Route templates and constraints, query string binding, NavigationManager, NavLink matching, nested layouts and the .NET 10 NotFound handling, observed in a running app.
Razor Syntax and Component Compilation
How a .razor file becomes a C# class (EmitCompilerGeneratedFiles), what each directive generates, what BuildRenderTree does with markup, the rules of @, the RZ10012 warning, and Razor versus Razor Pages versus Blazor.
Blazor SSR State: TempData, Session and CacheView
Five places to keep state in a static SSR page (query string, posted form, TempData, session, CacheView), the .NET 11 attributes and components, the one-shot trap of the TempData property, the session envelope and the CSRF rule, all run on the 11.0.100 GA.
Components & Forms
Blazor Component Lifecycle and Parameters
Which lifecycle hooks run in the prerender and in the interactive instance, when OnParametersSet fires, EventCallback versus a delegate, StateHasChanged and the dispatcher, cascading values and @key, measured with logs.
Blazor Data Access and Streaming Rendering
Why a DbContext injected into an interactive component lives as long as the circuit, IDbContextFactory, the duplicate query from prerendering and PersistentState, and why WebAssembly needs an API.
Blazor Forms: EditForm and Validation
Model, EditContext and DataAnnotationsValidator, when each rule fires, nested object and collection validation in .NET 10, server-side errors with ValidationMessageStore, InputBase<T>, and the link to minimal API validation.
Blazor WebAssembly Client and API Integration
A standalone WebAssembly client calling an API on another origin, observed in a browser: CORS from both sides, the base address trap, named clients, download size with trimming, compression and invariant globalization, and lazy loading.
Blazor QuickGrid and Virtualize
QuickGrid with sorting and paging over an IQueryable and over an ItemsProvider, page and sort kept in the URL in .NET 11 (headers and pager as links), Virtualize with ItemsProvider, ItemComparer and the BL0011 warning, tested with WebApplicationFactory and bUnit 2.15.2.
Data Access Choices
EF Core, ADO.NET, Dapper and Choosing a Data Access Approach
ADO.NET, Dapper and EF Core as layers over one connection, the same query written three ways with measured timings, mixing them in one transaction, provider versions, and what Native AOT changes.
EF Core with NoSQL: Cosmos DB and MongoDB
What EF Core keeps and loses against document stores, the Cosmos DB partition key and point reads (checked on a real model), embedded documents and transactions in the MongoDB provider, and when to use the native driver.
ADO.NET: Connections, Commands, Readers and Pooling
Raw ADO.NET on .NET 10 measured on Npgsql and SQLite: the System.Data.Common object model, parameters vs SQL injection with the statement the server logged, execute methods and CommandBehavior, ordinal vs name reads, leaking and exhausting the pool, what Close() leaves on the server, Pooling=false, idle pruning, dead backends after a kill or restart, DbDataSource in DI, DbBatch and binary COPY, streaming vs ToList memory, and EF Core sharing the same pool.
EF Core
DbContext Lifetime and Change Tracking
One context per unit of work, pooling and IDbContextFactory, the entity states in the change tracker, and when AsNoTracking pays off.
EF Core CRUD Operations and Seeding
Model, DbContext, and SQLite registration, Add vs SaveChanges, FindAsync and projection, set-based update and delete, and seeding reference data with UseSeeding and HasData.
Loading Related Data and the N+1 Problem
Include and ThenInclude, cartesian explosion and AsSplitQuery, N+1 through lazy loading, projections, and reading the generated SQL with ToQueryString.
Query Translation and Performance in EF Core
Where LINQ to SQL translation stops, compiled queries, ExecuteUpdate and ExecuteDelete, FromSql vs FromSqlRaw, and keyset pagination.
Transactions and Optimistic Concurrency in EF Core
The implicit transaction in SaveChanges, concurrency tokens (rowversion and xmin), DbUpdateConcurrencyException, and a retry strategy combined with a manual transaction.
Explicit Transactions, Savepoints and TransactionScope
Explicit transaction control in EF Core 10 measured on SQLite and PostgreSQL: BeginTransaction across several SaveChanges, AutoTransactionBehavior in the log, the savepoint EF creates by itself, sharing a transaction with ADO.NET, the retrying execution strategy, isolation levels with two connections and a 40001 retry, SQLite isolation, TransactionScope and async flow, prepared transactions with two connections, and lock waits.
Multi-Tenancy: Discriminator vs Database per Tenant
Multi-tenant data access with EF Core 10, measured: a tenant filter bound to the context instance, filters that freeze the first tenant, writes the filter does not guard, unique indexes with TenantId, PostgreSQL row-level security and who bypasses it, database per tenant with factories and pooling, schema per tenant with IModelCacheKeyFactory, and what migrations do in each model.
EF Core Modeling
EF Core Model Building: Conventions, Annotations and Fluent API
Which of convention, data annotation and Fluent API wins (checked on the real model and migration), defaults with ConfigureConventions versus a finalizing convention, IEntityTypeConfiguration, HasData in the migration, and compiled models.
Relationships, Keys and Delete Behavior
Required versus optional and the ON DELETE each produces, what SaveChanges does with loaded and unloaded dependents (checked in the SQLite SQL), orphans, composite and alternate keys, shadow foreign keys and many-to-many with skip navigations.
Join Pruning and Foreign Keys Without Constraints in EF Core 11
EF Core 11 removes joins whose columns are never used, trusting the model to do it. ExcludeForeignKeyFromMigrations against IsConstrained(false), and a SQLite run with an orphan row where the same table answers 2 or 1 rows depending on the query. EF Core 10 against 11 with offline SQL.
Generated Values, Defaults and Computed Columns
HasDefaultValue, HasDefaultValueSql, computed columns and ValueGeneratedOn* with the real EF Core 10 INSERT and UPDATE on SQLite, the sentinel value trap, triggers versus RETURNING, and the SQL Server DDL with a sequence and a named default.
Inheritance Mapping: TPH, TPT and TPC
The three EF Core 10 inheritance strategies with the real schema and SQL on SQLite: the undeclared derived type that silently loses data, discriminators and shared columns, TPT joins, TPC unions, keys and missing foreign keys, and how to choose.
Reverse-Engineering an Existing Database
dotnet ef dbcontext scaffold on EF Core 10 against a legacy SQLite schema: what it generates for keys, defaults, join tables, views and keyless tables, the options that matter, re-scaffolding with partial classes and OnModelCreatingPartial, and customizing the T4 templates.
Value Converters, Comparers and Strongly-Typed Ids
Built-in and custom value converters in EF Core 10, ConfigureConventions per type, why null never reaches a converter, what translates and what fails in queries on converted members, the ValueComparer that keeps in-place edits from being lost, key comparers, strongly-typed ids from the column to the Minimal API route, the cost per row, and when a complex type, owned type or entity fits better, with the measured result of each experiment.
JSON Columns and Complex Types
ToJson on complex and owned types, collections in one JSON column, the real SQL generated to query and update inside the document (checked on SQLite), what does not translate, ExecuteUpdate over JSON, and what EF Core 10 changed.
EF Core Provider Differences: PostgreSQL, SQL Server and SQLite
One EF Core model measured on EF Core 10 and rerun on EF Core 11 GA against PostgreSQL 18 and SQLite, with SQL Server from the docs: case sensitivity and collations (ICU nondeterministic, citext, NOCASE), DateTime and DateTimeOffset rules, decimal storage and precision, identity, GUID generation and batching, ALTER COLUMN versus table rebuild, arrays, JSON and enums, concurrency tokens, and why tests on SQLite miss production bugs.
Temporal Tables and History Queries in EF Core
IsTemporal, TemporalAsOf, TemporalAll, TemporalBetween and the other operators, the DDL and SQL EF Core 11 generates (offline, no server), converting an existing table, restoring a deleted row and period columns as CLR properties, new in EF Core 11. A SQL Server feature, not run against a server.
EF Core Querying
EF Core Logging, Query Tags and Diagnostics
ToQueryString, LogTo and ILogger by category, sensitive data and detailed errors, TagWith and interceptors that count commands.
Global and Named Query Filters (EF Core 10)
HasQueryFilter for soft delete and multi-tenancy, EF Core 10 named filters with selective IgnoreQueryFilters, and the required-navigation trap.
Raw SQL, Unmapped Types and Views
SqlQuery<T> for types outside the model, ExecuteSql, and keyless entities for views and defining queries on EF Core 10, with the real SQL on SQLite: the Value alias, filters that SqlQuery skips, silent extra columns, and the ToSqlQuery mapping that still creates a table.
EF.Functions and Database-Specific Translation
How a .NET method becomes SQL, LIKE, Collate and Random run on SQLite with the real SQL, wildcards in user input, Single versus First, provider-specific functions, and mapping your own database function.
SQL Server 2025 JSON Queries: JSON_CONTAINS and JSON_PATH_EXISTS in EF Core 11
When Contains over a JSON collection becomes JSON_CONTAINS (compatibility level 170) and when it stays OPENJSON, EF.Functions.JsonContains (experimental, EF9106) and JsonPathExists, with the table of variations that decides the parameter case. SQL generated offline, no server.
Full-Text Search with EF Core: SQL Server, PostgreSQL and SQLite
When LIKE '%x%' stops being enough. Full-text catalog and index in the model (EF Core 11), FreeText and Contains, FreeTextTable and ContainsTable with a rank, tsvector and GIN on PostgreSQL (run on Npgsql 11.0.0 and PostgreSQL 18.7), and SQLite FTS5 actually run, with bm25, triggers and the user input that breaks MATCH.
Vector Search with EF Core 11 and SQL Server 2025: Exact, Approximate and Hybrid
SqlVector<float> columns, CREATE VECTOR INDEX from migrations, VectorDistance for exact search, VectorSearch().Take().WithApproximate() for the index, the warning for forgetting it, the T-SQL EF Core 11 generates, hybrid search with full-text and FullJoin, and the vector column no longer loaded with the entity. Offline SQL, not run against a server.
EF Core Interceptors, Events and Auditing
The EF Core 10 interceptor families and the order of their hooks, registration versus DI lifetimes, the sync hook that never calls the async one, short-circuiting with InterceptionResult, a same-transaction audit and soft-delete interceptor and what bypasses it, a slow-query log and a tenant id for row-level security on PostgreSQL, the .NET events and the cost of an interceptor, with the measured result of each experiment.
EF Core Compiled Models and Startup Time
dotnet ef dbcontext optimize, what the compiled model generates and how EF Core finds it, what changes in EF Core 11 (EFOptimizeContext removed), startup measured with and without a compiled model on 60 and 300 entities, the stale model nobody notices, and precompiled queries, still experimental.
Migrations
EF Core Migrations Workflow
The model snapshot, reviewing generated SQL (a rename that becomes drop and add), data changes in migrationBuilder.Sql, and snapshot conflicts between branches.
Applying Migrations in Production
The risks of Migrate() at startup with several replicas, idempotent scripts, migration bundles, expand and contract, and concurrent index builds in PostgreSQL.
Upgrading from EF Core 10 to 11: Breaking Changes
The silent breaks of the EF Core 10 to 11 upgrade, reproduced on 11.0.0: Migrate() without migrations, Property() on a primitive collection, obsolete OwnsMany().ToJson() and the SQL Server compatibility level.
Application Architecture
Clean Architecture in Four Projects
Domain, Application, Infrastructure, and Api with one dependency rule pointing inward, what goes in each layer, how to test each one, and when it is enough before a modular monolith.
CQRS, Mediator and Vertical Slices
Commands and queries as separate types without event sourcing, a minimal hand-written mediator, pipeline behaviors for validation, logging and transactions, vertical slices with Minimal APIs, the library situation after MediatR's license change (checked on NuGet and the official site), and when not to use a mediator.
Modular Architecture
From CRUD to Modular Monolith
A concrete, step by step path from a single-project CRUD API to two modules (Catalog and Orders) with separate projects, schemas, and a contract between them.
Modular Monolith: Drawing Module Boundaries
Projects, internal visibility, and a contracts assembly per module as a boundary the .NET compiler enforces, with one schema and one DbContext per module.
Module Communication and Architecture Tests
Synchronous queries through contracts, outbox-backed integration events for reliable delivery, and architecture tests that turn dependency rules into a failing build.
Testing Modules in Isolation
Host one module with a real database, replace the other modules with fakes of their contracts, test outbox events without sleeping, and keep a few full-application tests for the seams.
DDD
Aggregates, Entities, and Value Objects
Records as value objects, strongly-typed IDs, an aggregate root that guards invariants, and encapsulated collections, with the cost of each choice.
Mapping the Domain with EF Core
Owned types vs complex types, value converters, private constructors and backing fields, and when a repository is worth wrapping around the DbContext.
Domain Events and Consistency Boundaries
Events raised by the aggregate and dispatched from a SaveChanges interceptor, domain vs integration events, and the one-aggregate-per-transaction rule.
Event Sourcing and Projections with Marten
Event sourcing on PostgreSQL with Marten 9.62 measured in Docker: the mt_events and mt_streams tables, the cost of rebuilding streams of 10, 1,000 and 10,000 events, the optimistic concurrency collision with FetchForWriting and EventStreamUnexpectedMaxEventIdException, Inline, Live and Async projections with the measured daemon lag (1 s default, 7 ms with LISTEN/NOTIFY), a 100,000-event rebuild, snapshots against replay, upcasting and event type aliases, the event store as a natural outbox through subscriptions, and when not to use event sourcing (CRUD, ad hoc reports, erasure laws). Ends with a table of concern, mechanism, guarantee and trap.
Distributed Actors
Background Jobs
Hosted Services and BackgroundService
IHostedService vs BackgroundService, unhandled exceptions that stop the host, scoped services through IServiceScopeFactory, PeriodicTimer, and graceful shutdown.
In-Memory Queues with Channels
Bounded Channel<T>, BoundedChannelFullMode, an endpoint as producer and a BackgroundService as consumer, and what a restart loses.
Durable Jobs with Hangfire and Quartz.NET
Persistent job storage, retries, idempotency under at-least-once delivery, recurring jobs, and passing IDs instead of entities.
Transactional Outbox, Inbox and Idempotent Consumers
The outbox row written in the same EF Core transaction, a BackgroundService relay with retries, backoff and dead-letter, an inbox with a deduplication key, idempotent consumers and at-least-once delivery, and what happens in each failure, every case driven by a fault-injecting test.
Message Brokers: MassTransit, Azure Service Bus and RabbitMQ
Queues, topics, competing consumers, at-least-once and dead-letter, MassTransit on the in-memory transport and test harness (publish versus send, retry and fault, an inbox check, the consumer outbox), what changes with RabbitMQ and Azure Service Bus, the MassTransit v9 commercial license (the lab pins the Apache-2.0 8.5.12) and alternatives.
Concurrency
Task and async/await Internals
The compiler state machine, SynchronizationContext and ConfigureAwait, deadlocks with .Result, async void, and the rules of ValueTask.
Data Parallelism: Parallel and PLINQ
CPU-bound vs I/O-bound work, Parallel.ForEachAsync, PLINQ, localInit and localFinally, and when parallel code gets slower.
Coordinating Concurrent Work
Cancellation and timeouts, throttling with SemaphoreSlim, fan-out and fan-in with Channels, TaskCompletionSource, and ConcurrentDictionary.GetOrAdd pitfalls.
Redis with StackExchange.Redis: Structures, Pub/Sub and Locks
Redis measured from C# in Docker: one multiplexer against one per call, a server dying mid-traffic, a transaction without rollback, Pub/Sub against Streams with the consumer down, a sorted-set rate limiter, eviction deleting a lock, a distributed lock whose holder pauses past the TTL and the fencing token that refuses the stale write, the Redlock debate, stampede, and the Redis, Valkey and Garnet licences.
Runtime Async in .NET 11
What changes when the runtime, not the compiler, suspends async methods: how to opt in (still documented as preview for your own code), what the BCL already does, live stack depth, allocation and time measured in Release, and what stays the same for ConfigureAwait, ValueTask, AsyncLocal and exception traces.
What's New & Migration
What's New in .NET 10: A Map of the Platform
A hub for the .NET 10 LTS release: what the official runtime, SDK and libraries pages list (JIT and stack allocation, file-based apps, one-shot tools, package pruning, numeric ordering, JSON options, async ZIP), each linked to the concept that explains it.
What's New in .NET 11: A Map of the Platform
A hub for the .NET 11 release (STS) run on the 11.0.100 SDK: runtime, SDK and CLI, base library, what the 11 runtime changes even for a net10.0 app, and one pointer each to the C# 15, ASP.NET Core 11 and EF Core 11 maps, with what is still preview or doc only marked.
Upgrading to .NET 11 and Reading the Breaking Changes
How to read the breaking changes page and the real 10 to 11 case, with before and after run on SDK 10 and SDK 11: silent numeric, ZIP, GZip and args[0] changes, the Native AOT publish default at GA, and the compiler breaks CS7083, CS8352, CS9380 and with(...) versus @with.
What's New in ASP.NET Core 10: A Map
A map of the ASP.NET Core 10 release notes grouped by hosting, Minimal APIs, OpenAPI, Blazor and Identity, separating automatic, opt-in and breaking changes, with a link to the concept that goes deep on each one.
What's New in ASP.NET Core 11: A Map
A map of the ASP.NET Core 11 release notes grouped into automatic, opt-in, breaking and experimental changes, saying which items were run on the 11.0.100 GA and which come only from the official page, with a link to the concept that goes deep on each one.
Migrating from ASP.NET Core 10 to 11
An upgrade checklist from the .NET 10 LTS, with before and after run on both SDKs: the NU1605 restore error from Microsoft.OpenApi 3.x, the OpenAPI 3.2 default, RunAsync throwing when a BackgroundService fails, scope disposal aggregating exceptions, an empty string winning in chained configuration and the automatic CSRF check, plus what comes only from the migration guide.
What's New in EF Core 10: A Map
A map of the EF Core 10 release (LTS, .NET 10): complex types and JSON, ExecuteUpdate, named query filters, parameterized collections, LeftJoin, security, SQL Server and Cosmos DB, each pointing to the concept that goes deep.
What's New in EF Core 11: A Map
A map of the EF Core 11 release (STS, .NET 11) with real SQL side by side against EF Core 10: leaner SQL, new translations, JSON path indexes, LastMigrationId, SQL Server 2025 and Cosmos DB.