Skip to content
Back to skills

Aspnet Core Knowledge Patch

ASecurity

ASP.NET Core

  • 25 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 5, 2026
developmenttypescriptc#shellreacttestingapisecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill aspnet-core-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Aspnet Core Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Aspnet Core Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-aspnet-core-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-aspnet-core-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: aspnet-core-knowledge-patch
description: ASP.NET Core
version: "11"
license: MIT
metadata:
  author: Nevaberry
---


# ASP.NET Core Knowledge Patch

> **Version scope:** This skill includes guidance from Microsoft’s ASP.NET Core in .NET 11 development release notes, which describe preview releases. Check the version and stability of each feature before using it with an earlier runtime. The references retain batch attribution.

Load this skill when migrating or implementing ASP.NET Core applications involving
Blazor, Minimal APIs, OpenAPI, hosting, authentication, validation, or diagnostics.
Use the quick references for common compatibility changes and the topic files for
the complete guidance, examples, conditions, and source attribution.

## Reference index

| Reference | Topics |
| --- | --- |
| [Components, Navigation, and Interop](references/components-navigation-and-interop.md) | Routing, QuickGrid, virtualization, JS interop, startup options, rendering, culture, and component services |
| [Forms, Validation, and Persistence](references/forms-validation-and-persistence.md) | Recursive, asynchronous, and localized validation; labels; persistent state; TempData; session |
| [Hosting, HTTP, Caching, and Security](references/hosting-http-caching-and-security.md) | Cookie responses, authorization metadata, TLS binding, device-bound sessions, antiforgery, compression, Kestrel, HTTP.sys, and caching |
| [Migrations, Assets, and Tooling](references/migrations-assets-and-tooling.md) | Boot configuration, fingerprinting, preloading, WebAssembly builds, Gateway, templates, testing, certificates, and local hostnames |
| [Observability, Identity, and SignalR](references/observability-identity-and-signalr.md) | Exception diagnostics, tracing, Identity instruments, clocks, passkeys, authentication refresh, cancellation, and circuit management |
| [OpenAPI, Minimal APIs, and JSON](references/openapi-minimal-apis-and-json.md) | Dependencies, transformers, schemas, document generation, binding failures, event streams, JSON Patch, and C# unions |

## Breaking changes and deprecations

### Boot configuration and caching

Blazor WebAssembly embeds its boot configuration in `dotnet.js`. Workflows reading
`blazor.boot.json` directly are affected, including the published-asset integrity
PowerShell script and DLL extension customization for builds that disable Webcil.
The custom boot-resource cache is removed; browser caching handles fingerprinted
client-side assets. Remove `BlazorCacheBootResources` from the client project file.

### Deprecated package and TLS callback

`Microsoft.AspNetCore.Grpc.Swagger` is deprecated.
Replace obsolete `TlsClientHelloBytesCallback` configuration with
`listenOptions.UseTlsClientHelloListener((connection, bytes) => Console.WriteLine(bytes.Length));`
before `listenOptions.UseHttps()`.

### Browser response streaming

Browser response streaming is enabled by default. `ReadAsStreamAsync()` can return
a `BrowserHttpReadStream` that supports only asynchronous I/O. For synchronous
reads, use `request.SetBrowserResponseStreamingEnabled(false)` per request, or
disable streaming globally with
`<WasmEnableStreamingResponse>false</WasmEnableStreamingResponse>` or
`DOTNET_WASM_ENABLE_STREAMING_RESPONSE=0`.

### Identity redirects during static rendering

When enabling `BlazorDisableThrowNavigationException` in an existing Individual
Accounts app, remove the fallback `InvalidOperationException` and `[DoesNotReturn]`
annotations from `IdentityRedirectManager`. Execution continues after `NavigateTo`
during static SSR with this setting; the .NET 10 template enables it by default.

### API cookie responses

Cookie authentication returns 401 for unauthenticated requests and 403 for forbidden
requests on endpoints marked with `IApiEndpointMetadata`. The framework adds this
metadata to `[ApiController]` actions, JSON-reading or JSON-writing Minimal APIs,
endpoints using `TypedResults`, and SignalR endpoints. To restore redirects, set
`OnRedirectToLogin` and `OnRedirectToAccessDenied` to call
`context.Response.Redirect(context.RedirectUri)` and return `Task.CompletedTask`.

### JSON converters and handled exceptions

MVC, Minimal APIs, and `HttpRequest.ReadFromJsonAsync()` can pass segmented JSON
tokens to custom converters. Check `reader.HasValueSequence` and read
`reader.ValueSequence` for those tokens. Temporarily restore stream-based parsing
with `AppContext.SetSwitch("Microsoft.AspNetCore.UseStreamBasedJsonParsing", true);`.

Exception handler middleware suppresses diagnostics by default when
`IExceptionHandler.TryHandleAsync` returns `true`. Set
`ExceptionHandlerOptions.SuppressDiagnosticsCallback` to `_ => false` to emit
diagnostics for handled exceptions again.

### OpenAPI dependency and transformer changes

The ASP.NET Core in .NET 11 development notes describe OpenAPI 3.2 as the default and
`Microsoft.OpenApi` 3.3.1 as the dependency; custom transformers may need OpenAPI.NET 3 changes.
Select OpenAPI 3.1 with
`builder.Services.AddOpenApi(o => o.OpenApiVersion = Microsoft.OpenApi.OpenApiSpecVersion.OpenApi3_1);`.
For ASP.NET Core 10.0.11, keep a direct `Microsoft.OpenApi` reference used alongside
`Microsoft.AspNetCore.OpenApi` on a compatible 2.x version: its dependency is 2.7.5
and excludes version 3.0 and later. The reference distinguishes this .NET 10.0.11 constraint from the .NET 11 development guidance.

### JSON Patch failure behavior

Install `Microsoft.AspNetCore.JsonPatch.SystemTextJson` to deserialize
`JsonPatchDocument<T>` with `JsonSerializer`. `ApplyTo` selects properties from the
target's runtime type and can leave it partially modified on failure. Apply the
patch to a copy and discard it if an operation fails. Keep the legacy implementation
for dynamic targets such as `ExpandoObject`.

## Validation and persistent state

### Recursive validation and assembly boundaries

For Blazor, register `builder.Services.AddValidation()`, declare models in `.cs`
files, and mark the root model with `[ValidatableType]` to validate nested objects
and collections through `DataAnnotationsValidator`. For models in a referenced
project, expose a method there that calls `AddValidation()` on the app's service
collection, then call that method as well as the app's own `AddValidation()`.

For Minimal APIs, call `AddValidation()` from the assembly defining the endpoints.
Positional record parameter attributes are recognized. Use `.DisableValidation()`
to opt an endpoint out or `IProblemDetailsService` to customize the error response.
Validation resolver APIs are experimental; `AddValidation()` and the built-in
endpoint filter are stable. `[ValidatableType]` and `[SkipValidation]` are no longer
experimental; remove `ASP0029` suppressions added for those attributes.

### Asynchronous and localized rules

`EditForm` awaits `AsyncValidationAttribute` and `IAsyncValidatableObject` rules
through `DataAnnotationsValidator`. Minimal APIs await asynchronous rules with
`AddValidation()`; implement synchronous `IsValid` or `Validate` too and have it
throw explicitly for async-only rules. Validators can run concurrently within a
member or across collection items in Minimal APIs.
Call `AddLocalization()` before `AddValidation()` to localize generated validation
messages and display names for Minimal APIs and Blazor. The reference gives custom
validator registration and resource lookup details.

### Persistence, restoration, and static forms

Mark public service properties with `[PersistentState]` and register the service
type and render mode on the builder returned by `AddRazorComponents()`, for example
with `RegisterPersistentService<CartState>(RenderMode.InteractiveServer)`.
Interactive components load incoming persistent state on initial load by default;
`[PersistentState(AllowUpdates = true)]` permits updates on subsequent enhanced
navigations. Use `RestoreBehavior = RestoreBehavior.SkipInitialValue` to skip the
prerendered value, or `RestoreBehavior.SkipLastSnapshot` to skip the last snapshot
on reconnection. Custom serializers handle persistence and restoration of their
registered type, with JSON as the fallback when no custom serializer is registered.

Static SSR forms with `DataAnnotationsValidator` get browser-side validation by
default, with or without enhanced forms. Blazor Web Apps inject CSRF protection
middleware by default, so an explicit `app.UseAntiforgery()` is generally optional.

## Blazor navigation, assets, and rendering

### Routing and grid behavior

Replace the legacy `<NotFound>` fragment with a routable page through
`Router.NotFoundPage`. For `NavigationManager.NotFound()`, a path set in
`NavigationManager.OnNotFound` via `NotFoundEventArgs.Path` takes precedence, then
`Router.NotFoundPage`, then the path from `UseStatusCodePagesWithReExecute`.
`NavigationManager.NavigateTo` no longer resets scrolling to the top when same-page
navigation changes a query string or fragment. `NavLinkMatch.All` ignores both;
the navigation reference includes the switch to restore their participation.

QuickGrid sorting and paging use links and work in static SSR. `page` is one-based,
`sort` keys on the column's `Title`, and `direction` is `asc` or `desc`; changing a
title can break saved URLs. Give each grid its own `PaginationState` and distinct
query keys. The reference includes CSS changes and the interactive-button switch.

### Virtualization

`Virtualize` adapts to changing item heights; `OverscanCount` defaults to `15`.
Use `AnchorMode="End"` to stay at the end as items arrive or `AnchorMode="None"`
to disable edge pinning; the default is `Start`. Set `InitialItemIndex` for the
first interactive render and call `await list.ScrollToItemAsync(0)` afterward.
Out-of-range indexes are clamped, the last overlapping call wins, and calling
before the first interactive render throws. QuickGrid forwards these APIs with
`Virtualize="true"`; its `AnchorMode` and `ItemComparer` are experimental under
diagnostic `ASP0030`.

### Asset setup and hosting

Automatic inclusion of `blazor.web.js` and `blazor.server.js` requires at least one
`.razor` file. In projects without components that need the script, set
`<RequiresAspNetWebAssets>true</RequiresAspNetWebAssets>` in the project file.
In a Blazor Web App, put `<ResourcePreloader />` immediately after `<base>` in
`App.razor`; remove it when `loadBootResource` rewrites URLs. The asset reference
contains standalone fingerprinting, preloading, build environment, and PWA setup.

Replace `Microsoft.AspNetCore.Components.WebAssembly.DevServer` with
`Microsoft.AspNetCore.Components.Gateway` to serve standalone WebAssembly apps in
development and production. Set
`<StaticWebAssetSpaFallbackEnabled>true</StaticWebAssetSpaFallbackEnabled>` and
remove `inspectUri` from launch profiles.

## API documents, connections, and hosting

### Binding failures and generated documents

Endpoint filters run when parameter binding fails and can detect
`HttpContext.Response.StatusCode == 400`. In Development, configure
`builder.Services.Configure<RouteHandlerOptions>(options => options.ThrowOnBadRequest = false);`
to surface the 400 to the filter.
Inject `IOpenApiDocumentProvider` to access a generated document outside requests.
Use `context.GetOrCreateSchemaAsync(typeof(ProblemDetails))` in document, operation,
or schema transformers; operation and schema transformers can add it with
`context.Document?.AddComponent("ProblemDetails", schema)`.

### SignalR refresh and Blazor circuits

Enable connection identity refresh with
`app.MapHub<ChatHub>("/chat", options => options.EnableAuthenticationRefresh = true);`.
Use `options.OnAuthenticationRefresh` to accept or reject a principal and
`Hub.OnAuthenticationRefreshedAsync()` to react after it is applied. The .NET client
enables automatic refresh by default; TypeScript configuration is in the reference.
Interactive Server enables refresh on its component hub and client and raises
`AuthenticationStateChanged` with the refreshed principal.

Interactive Server can restore persisted circuit state after a prolonged disconnect
or deliberate pause if the user resumes without a full-page refresh.
`await circuit.RequestCircuitPauseAsync(cancellationToken)` returning `true` means
the request was accepted and the client was asked to begin pausing. The token can
cancel the request before acceptance.

### Caching and HTTP behavior

`CacheView` caches rendered HTML during static SSR; a cache hit skips construction
and lifecycle execution of its children. `IOutputCachePolicyProvider` selects base
and named output-cache policies dynamically.
Zstandard (`zstd`) is enabled by default in response compression and request
decompression when the respective middleware is used. Response compression emits
`Vary: Accept-Encoding` even for an uncompressed response.
`options.Limits.RequestHeadersTimeout` also applies while Kestrel waits for
fragmented HTTP/2 or HTTP/3 trailer headers to complete.

Files in this skill

  • SKILL.md8.6 KB
  • coverage.json1.2 KB
  • references/components-navigation-and-interop.md3.3 KB
  • references/forms-validation-and-persistence.md1.8 KB
  • references/hosting-http-caching-and-security.md1.2 KB
  • references/migrations-assets-and-tooling.md2.6 KB
  • references/observability-identity-and-signalr.md2 KB
  • references/openapi-minimal-apis-and-json.md2.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.