Skip to content

What's new in ASP.NET Core in .NET 11 Preview 6#37334

Draft
wadepickett with Copilot wants to merge 3 commits into
mainfrom
copilot/update-whats-new-in-aspnetcore-11
Draft

What's new in ASP.NET Core in .NET 11 Preview 6#37334
wadepickett with Copilot wants to merge 3 commits into
mainfrom
copilot/update-whats-new-in-aspnetcore-11

Conversation

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Adds Preview 6 content to the cumulative "What's new in ASP.NET Core in .NET 11" article, generated from the dotnet/core release notes (dotnet/core#10456) via the whats-new-from-release-notes agent.

Note on parameters: The issue body listed PREVIEW = preview5, but the referenced source PR and the issue title are both Preview 6. Processed Preview 6 accordingly.

New include files

  • Minimal APIsasync-validation-minimal-apis-preview-6.md (IAsyncValidatableObject, AsyncValidationAttribute, Validator.ValidateObjectAsync), short-circuit-endpoints-attribute-preview-6.md ([ShortCircuit])
  • OpenAPIopenapi-3-2-default-preview-6.md (documents now target 3.2 by default)
  • SignalRsignalr-authentication-refresh-preview-6.md (token refresh without reconnect), signalr-cancel-hub-invocations-preview-6.md (client-side cancellation of non-streaming invocations)

Updated files

  • csharp-unions-preview-6.md — expanded to reflect the grown source: unions now span Minimal APIs, MVC/Razor Pages, SignalR JSON hub protocol, and Blazor, plus OpenAPI anyOf schema behavior and non-body binding limits.
  • aspnetcore-11.md — added [!INCLUDE] directives in the mapped sections; bumped ms.date to 07/10/2026; Breaking changes section left intact.

Excluded (per content rules)

  • Blazor Virtualize scroll-to-item — owned by the Blazor docs team; flagged, not authored here.
  • Bug fixes and the standalone contributors list — inline contributor thank-yous (@Youssef1313, @Porozhniakov) are preserved within their feature includes.

Conventions

Includes use H3 headings, no front matter, -preview-6 suffixes, relative Learn links, and present-tense phrasing. Verified <xref:> IDs are used where docs exist; brand-new Preview 6 APIs without published docs carry <!-- TODO: Update to <xref:> ... --> markers for later conversion.


Internal previews

📄 File 🔗 Preview link
aspnetcore/release-notes/aspnetcore-11.md What's new in ASP.NET Core in .NET 11

Copilot AI changed the title [WIP] Update What's new in ASP.NET Core in .NET 11 Preview 6 What's new in ASP.NET Core in .NET 11 Preview 6 Jul 10, 2026
Copilot AI requested a review from wadepickett July 10, 2026 20:24
@wadepickett wadepickett requested a review from tdykstra July 10, 2026 20:25
@wadepickett

Copy link
Copy Markdown
Contributor

@tdykstra and @guardrex,
I started a draft for this. There may be udpates of the release notes to sync with between now and the final version. This does not include any update related to Blazor yet @guardrex since you usually like to do you own, but you can add to this draft if you want. As a reminder I am not available all next week. Tdykstra will take this over from here for any sync.

@guardrex

guardrex commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

@wadepickett ... Thanks!👍 Illona has a PR up, and I have one with only the Blazor C# union bits on it. I'll check next week to see what else Blazor needs. I'll review this Monday morning (without commits from me) to assist @tdykstra with the approval he'll need.

Comment thread aspnetcore/release-notes/aspnetcore-11/includes/csharp-unions-preview-6.md Outdated
Comment thread aspnetcore/release-notes/aspnetcore-11/includes/openapi-3-2-default-preview-6.md Outdated
Comment thread aspnetcore/release-notes/aspnetcore-11/includes/csharp-unions-preview-6.md Outdated
Edit pass.

Co-authored-by: Wade Pickett <wpickett@microsoft.com>

@guardrex guardrex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with a handful of NIT suggestions.


<!-- TODO: Update `AsyncValidationAttribute`, `IAsyncValidatableObject`, and `Validator.ValidateObjectAsync` to <xref:> once API docs are published. -->

Asynchronous validation lets a validation rule do real work, such as a database lookup or a remote API call, without blocking a thread. A model implements `IAsyncValidatableObject` and returns validation results as an `IAsyncEnumerable<ValidationResult>`. Because `IAsyncValidatableObject` extends `IValidatableObject`, also implement the synchronous `Validate` method. When a type validates asynchronously only, throw from `Validate` so it isn't silently validated through the synchronous APIs:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Asynchronous validation lets a validation rule do real work, such as a database lookup or a remote API call, without blocking a thread. A model implements `IAsyncValidatableObject` and returns validation results as an `IAsyncEnumerable<ValidationResult>`. Because `IAsyncValidatableObject` extends `IValidatableObject`, also implement the synchronous `Validate` method. When a type validates asynchronously only, throw from `Validate` so it isn't silently validated through the synchronous APIs:
Asynchronous validation lets a validation rule do real work, such as a database lookup or a remote API call, without blocking a thread. A model implements `IAsyncValidatableObject` and returns validation results as an `IAsyncEnumerable<ValidationResult`. Because `IAsyncValidatableObject` extends `IValidatableObject`, also implement the synchronous `Validate` method. When a type validates asynchronously only, throw from `Validate` so it isn't silently validated through the synchronous APIs:

[EnumeratorCancellation] CancellationToken cancellationToken = default)
{
var rooms = context.GetRequiredService<IRoomService>();
if (!await rooms.HasAvailabilityAsync(Date, cancellationToken))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional; but AFAIK (and what I've been doing in the Blazor node and samples), framework coding calls for a line between the start of an if expression and a preceding code line.

Suggested change
if (!await rooms.HasAvailabilityAsync(Date, cancellationToken))
if (!await rooms.HasAvailabilityAsync(Date, cancellationToken))

### C# union types

ASP.NET Core supports [C# union types](/dotnet/csharp/whats-new/csharp-14#union-types) (new in .NET 11) anywhere [`System.Text.Json`](/dotnet/standard/serialization/system-text-json/overview) is used: JSON request and response bodies in Minimal APIs and MVC, SignalR's `JsonHubProtocol`, Blazor JavaScript interop, persistent component state, and prerendered component parameters.
C# union types are a preview language feature in .NET 11 (see the [C# release notes](/dotnet/csharp/whats-new/csharp-14#union-types)), and [`System.Text.Json`](/dotnet/standard/serialization/system-text-json/overview) serializes them natively. Because ASP.NET Core uses `System.Text.Json` for JSON, union types work as JSON request bodies and return types throughout the stack with no ASP.NET-specific configuration:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also place the C# language reference cross-link here as well, but this is What's New, so perhaps it's best to leave it as-is. I went through on the Blazor PR and updated all of the non-What's New references to use the reference doc, so we won't be saddled with pointing devs to a What's New language feature article in reference content when the language reference article exists. Here's the link in case you want to see or use it ...

https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/union

Union types aren't supported for non-body binding sources such as route values, query strings, headers, and form fields. No newline at end of file
For OpenAPI, an endpoint that returns a union is described with an `anyOf` schema listing each case type. Unlike polymorphic types, union cases don't carry a `$type` discriminator, so a case such as `Dog` reuses the standalone `#/components/schemas/Dog` component instead of a duplicated, prefixed one. ApiExplorer detects a union through `JsonTypeInfoKind.Union`, so the schema also flows through to Swashbuckle and NSwag.

A few limits apply. Only JSON request bodies and responses are supported — binding a union from the query string, route values, headers, or form fields isn't yet available. When multiple cases serialize to the same JSON shape, disambiguate them with a `[JsonUnion]` classifier. SignalR unions require the JSON hub protocol; the MessagePack and Newtonsoft.Json protocols don't support unions. No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A few limits apply. Only JSON request bodies and responses are supportedbinding a union from the query string, route values, headers, or form fields isn't yet available. When multiple cases serialize to the same JSON shape, disambiguate them with a `[JsonUnion]` classifier. SignalR unions require the JSON hub protocol; the MessagePack and Newtonsoft.Json protocols don't support unions.
A few limits apply. Only JSON request bodies and responses are supportedbinding a union from the query string, route values, headers, or form fields isn't yet available. When multiple cases serialize to the same JSON shape, disambiguate them with a `[JsonUnion]` classifier. SignalR unions require the JSON hub protocol; the MessagePack and `Newtonsoft.Json` protocols don't support unions.

@@ -0,0 +1,12 @@
### OpenAPI 3.2 by default

Generated OpenAPI documents now target OpenAPI 3.2 by default. Documents continue to generate as before; set the document version explicitly if you need to target an earlier version for tooling that hasn't adopted 3.2 yet.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Generated OpenAPI documents now target OpenAPI 3.2 by default. Documents continue to generate as before; set the document version explicitly if you need to target an earlier version for tooling that hasn't adopted 3.2 yet.
Generated OpenAPI documents now target OpenAPI 3.2 by default. Documents continue to generate as before. Set the document version explicitly if you need to target an earlier version for tooling that hasn't adopted 3.2 yet.


<!-- TODO: Update `[ShortCircuit]` to <xref:> once API docs are published. -->

Short-circuiting is useful for endpoints that don't need authentication, CORS, or other middleware — for example a health check or a robots.txt response — and it avoids the cost of running that middleware. The endpoint still runs and produces its response. Pass an optional status code, such as `[ShortCircuit(404)]`, to set the response status code.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still need to understand if the repo's convention for code-fencing all filenames and paths remains in effect after the "freshness" pass.

Suggested change
Short-circuiting is useful for endpoints that don't need authentication, CORS, or other middlewarefor example a health check or a robots.txt responseand it avoids the cost of running that middleware. The endpoint still runs and produces its response. Pass an optional status code, such as `[ShortCircuit(404)]`, to set the response status code.
Short-circuiting is useful for endpoints that don't need authentication, CORS, or other middlewarefor example a health check or a `robots.txt` responseand it avoids the cost of running that middleware. The endpoint still runs and produces its response. Pass an optional status code, such as `[ShortCircuit(404)]`, to set the response status code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent gen What's new in ASP.NET Core in .NET 11 Preview 6

4 participants