Back to Aspnetcore

What's new in ASP.NET Core in .NET 10

aspnetcore/release-notes/aspnetcore-10.0.md

latest4.8 KB
Original Source

What's new in ASP.NET Core in .NET 10

This article highlights the most significant changes in ASP.NET Core in .NET 10 with links to relevant documentation.

Blazor

This section describes new features for Blazor.

[!INCLUDE]

Blazor Hybrid

This section describes new features for Blazor Hybrid.

[!INCLUDE]

SignalR

This section describes new features for SignalR.

Minimal APIs

This section describes new features for Minimal APIs.

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

OpenAPI

This section describes new features for OpenAPI.

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

Authentication and authorization

Authentication and authorization metrics

Metrics have been added for certain authentication and authorization events in ASP.NET Core. With this change, you can now obtain metrics for the following events:

  • Authentication:
    • Authenticated request duration
    • Challenge count
    • Forbid count
    • Sign in count
    • Sign out count
  • Authorization:
    • Count of requests requiring authorization

The following image shows an example of the Authenticated request duration metric in the Aspire dashboard:

For more information, see xref:log-mon/metrics/built-in#microsoftaspnetcoreauthorization.

[!INCLUDE]

[!INCLUDE]

Miscellaneous

This section describes miscellaneous new features in .NET 10.

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

[!INCLUDE]

Detect if URL is local using RedirectHttpResult.IsLocalUrl

Use the new RedirectHttpResult.IsLocalUrl(url) helper method to detect if a URL is local. A URL is considered local if the following are true:

URLs using virtual paths "~/" are also local.

IsLocalUrl is useful for validating URLs before redirecting to them to prevent open redirection attacks.

csharp
if (RedirectHttpResult.IsLocalUrl(url))
{
    return Results.LocalRedirect(url);
}

Thank you @martincostello for this contribution!

Breaking changes

Use the articles in Breaking changes in .NET to find breaking changes that might apply when upgrading an app to a newer version of .NET.