ASP.NET Core
news

24stories

Stories

ASP.NET Core 10
Refuse bad requests well
DVDEV Community: #aspnetcore MICHAEL-MAURICE Oct 24

Six Requests a Minimal API Should Refuse, and Their Status Codes

How should a warehouse order API refuse illegal state changes, short stock, stale ETag writes and malformed JSON? The author builds a pick-pack-ship demo on .NET 10 Minimal APIs and EF Core 10, mapping each refusal to a specific status code, such as 409, 412 and 400. He also explains why an exact retry should return 200 instead of an error. A useful guide for anyone designing workflow endpoints.

ASP.NET Core
Revoke tokens instantly
MJMilan Jovanović [email protected] (Milan Jovanović) Oct 24

How to Revoke a JWT Before It Expires in ASP.NET Core

ASP.NET Core validates a JWT by its signature and expiry, so a stolen token keeps working after a password change. The article walks through two fixes: short-lived access tokens paired with revocable refresh tokens, then a token_version check for immediate revocation. Every .NET developer running JWT-based APIs should know where the gap is and what each fix costs.

ASP.NET Core 10
Fix common API mistakes
DVDEV Community: #aspnetcore Pankaj Singh Oct 23

Six common ASP.NET Core Web API mistakes and the patterns to use instead

A developer who has maintained ASP.NET Core APIs for years lists six recurring problems: scattered try/catch blocks, unbounded list queries, ignored cancellation tokens, lost UTC kinds, late config failures and unprotected login endpoints. Each comes with a suggested pattern using .NET 10 and EF Core 10, noted to work on .NET 8 with small changes.

ASP.NET Core 10
Wrong page from cache
DVDEV Community: #aspnetcore Sukhpinder Singh Oct 22

SetVaryByQuery Can Make ASP.NET Core Output Cache Serve Wrong Pages

The article explains how calling SetVaryByQuery in an ASP.NET Core output cache policy replaces the default vary-by-all-query-keys behavior. A policy that names only sort stops varying by page, so different pages can receive the same cached body. The author reproduces the bug with a small test and shows the fix.

ASP.NET Core 10
Headers are not server cache
DVDEV Community: #aspnetcore Sukhpinder Singh Oct 22

Cache-Control Header Is Not Output Caching: A Handler Counter Test

The author compares a Cache-Control header with ASP.NET Core output caching using a handler counter. The header only instructs clients and proxies, so the handler ran on all ten calls, while output caching stored the response on the server and ran the handler once. It is a concrete warning for anyone who thinks a cache header caches on the server.

ASP.NET Core
Server time in DevTools
MBMaarten Balliauw Maarten Balliauw Oct 22

Server-Timing Headers in ASP.NET Core: Backend Metrics in Browser DevTools

Maarten Balliauw shows how to add a Server-Timing response header in ASP.NET Core so database and external API timings appear in browser DevTools next to the network timings. The post builds a small middleware, a measurement feature that endpoints can use, and ways to reuse OpenTelemetry Activity data. It also covers gating the header so internal timings are not exposed to every caller.

ASP.NET Core SignalR
Messages across servers
CCC# Corner Ananya Desai Oct 21

How to Scale SignalR Applications Across Multiple Servers

This guide explains how to scale ASP.NET Core SignalR across several servers using either a Redis backplane or Azure SignalR Service. It covers why messages fail to reach clients on other servers, how each option distributes them, and when sticky sessions are still needed. It is a practical starting point for teams moving real-time apps into production.

ASP.NET Core 11
Validation messages translated
KAKhalid Abuhakmeh Khalid Abuhakmeh Oct 20

Localize Minimal API validation messages in .NET 11

ASP.NET Core 11 adds built-in localization for validation messages and display names in Minimal APIs and Blazor. Registering AddValidation and AddLocalization, plus culture-specific resx files, is enough to return 400 responses in the caller's language. The author shows a working sample and an integration test across four cultures.

xapi-dotnet 0.2.0
Lessons from an xAPI library
DVDEV Community: #aspnetcore Nurullah Türkoğlu Oct 17

What I learned building an xAPI 2.0 library and LRS for .NET

The author built xapi-dotnet, an xAPI 2.0 (IEEE 9274.1.1) library with statement models, an async client, a durable outbox and an LRS that runs inside ASP.NET Core. The write-up covers conformance testing in CI, reflection-free JSON handling for Native AOT and Unity, and the real cost of durable writes. Useful for any team sending e-learning data from .NET.

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message