Skip to content

Update "What's new in ASP.NET Core in .NET 10" for .NET 10 RC1 #35994

Closed

Description

@danroth27

Description

Update "What's new in ASP.NET Core in .NET 10" for .NET 10 RC1

Page URL

https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-10.0?view=aspnetcore-9.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/release-notes/aspnetcore-10.0.md

Document ID

a7ad4b01-2333-32d8-b759-e044edfb9102

Platform Id

2f8fb8ab-5309-0a77-987a-c867c6517d2b

Article author

@wadepickett

Metadata

  • ID: a7ad4b01-2333-32d8-b759-e044edfb9102
  • PlatformId: 2f8fb8ab-5309-0a77-987a-c867c6517d2b
  • Service: aspnet-core
  • Sub-service: release-notes

Related Issues


Associated WorkItem - 486311

Activity

  1. added
    Source - Docs.ms
    on Aug 25, 2025
  2. pinned this issue on Aug 25, 2025
  3. removed
    Source - Docs.ms
    on Aug 26, 2025
  4. JamesNK commented on Aug 27, 2025

    @JamesNK
    Member

    New ASP.NET Core Identity metrics

    ASP.NET Core Identity observability has been improved in .NET 10 with metrics. Metrics are counters, histograms and gauges that provide time-series measurements of system or application behavior.

    For example, you can use the new ASP.NET Core Identity metrics to observe user management, such as new user creations, password changes and role assignments. And you can use the metrics to observe login/session handling, such as login attempts, sign ins and sign outs, and users using two factor authentication.

    The new metrics are in the Microsoft.AspNetCore.Identity meter:

    • aspnetcore.identity.user.create.duration
    • aspnetcore.identity.user.update.duration
    • aspnetcore.identity.user.delete.duration
    • aspnetcore.identity.user.check_password_attempts
    • aspnetcore.identity.user.generated_tokens
    • aspnetcore.identity.user.verify_token_attempts
    • aspnetcore.identity.sign_in.authenticate.duration
    • aspnetcore.identity.sign_in.check_password_attempts
    • aspnetcore.identity.sign_in.sign_ins
    • aspnetcore.identity.sign_in.sign_outs
    • aspnetcore.identity.sign_in.two_factor_clients_remembered
    • aspnetcore.identity.sign_in.two_factor_clients_forgotten

    For more information about using metrics in ASP.NET Core, see ASP.NET Core metrics.

  5. oroztocil commented on Aug 28, 2025

    @oroztocil
    Member

    ✔️ Resolved — Validation improvements for Blazor and Minimal APIs

    Several features and fixes have been added to the new validation API that is coming in .NET 10 for Minimal APIs and Blazor. The RC1 updates are focused on providing feature parity and behavioral compatibility with the existing System.ComponentModel.DataAnnotations.Validator.

    Type-level validation attributes

    The new validations now support attributes placed on classes and records themselves.

    [SumLimit(42)]
    record Point(int X, int Y);
    
    class SumLimitAttribute(int Limit) : ValidationAttribute
    {
        protected override ValidationResult? IsValid(object? value, ValidationContext _)
        {
            if (value is Point point && point.X + point.Y > Limit)
            {
                return new ValidationResult("The sum of X and Y is too high");
            }
            return ValidationResult.Success;
        }
    }

    Skipping validation

    A new [SkipValidation] attribute can be used to omit selected properties, parameters, or types from validation. When applied to a property or a method parameter, the validator skips that value during validation. When applied to a type, the validator skips all properties and parameters of that type.

    This can be useful, in particular, when using the same model types in cases which require and do not require validation.

    class Order
    {
        public Address PaymentAddress { get; set; }
    
        [SkipValidation]
        public Address ContactAddress { get; set; }
    
        // ...
    }
    
    class Address
    {
        [Required]
        public string Street { get; set; }
    
        // ...
    }

    Additionally, properties annotated with the [JsonIgnore] attribute are now also omitted from validation to improve consistency between serialization and validation in the context of JSON models. Note that the [SkipValidation] attribute should be preferred in general cases.

    Backwards-compatible behavior

    Type validation logic has been updated to match the behavior of System.ComponentModel.DataAnnotations.Validator with regards to order of validations and short-circuiting. This means that the following rules are applied when validating an instance of type T:

    1. Member properties of T are validated, including recursively validating nested objects.
    2. Type-level attributes of T are validated.
    3. The IValidatableObject.Validate method is executed, if T implements it.

    In case one of these steps produces a validation error, the following steps are skipped.

    Resolved by #35972.

  6. added
    reQUEST
    on Sep 2, 2025
  7. added
    seQUESTered
    and removed
    reQUEST
    on Sep 3, 2025
  8. mikekistler commented on Sep 4, 2025

    @mikekistler

    Model nullable types using oneOf in OpenAPI schema

    OpenAPI schema generation for nullable types was improved by using the oneOf pattern instead of the nullable property for complex types and collections. The implementation:

    • Uses oneOf with null and the actual type schema for nullable complex types in request/response schemas
    • Implements proper nullability detection for parameters, properties, and return types using reflection and NullabilityInfoContext
    • Prunes null types from componentized schemas to avoid duplication

    Fixes/improvements to schema reference resolution

    This release improves the handling of JSON schemas for OpenAPI document generation by properly resolving relative JSON schema references ($ref) in the root schema document.

    Include property descriptions as siblings of $ref in OpenAPI schema

    Prior to .NET 10, ASP.NET Core discarded descriptions on properties that were defined with $ref in the generated OpenAPI document. This was necessary because OpenAPI v3.0 did not allow sibling properties alongside $ref in schema definitions. But this restriction has been relaxed in OpenAPI 3.1, allowing descriptions to be included alongside $ref. Support was added in RC1 to include property descriptions as siblings of $ref in the generated OpenAPI schema.

    This was a community contribution. Thanks @desjoerd!

    Add metadata from XML comments on [AsParameters] types to OpenAPI schema

    Support has been added for processing XML comments on properties of [AsParameters] parameter classes to extract metadata for use in OpenAPI documentation generation.

    Exclude unknown HTTP methods from OpenAPI

    OpenAPI schema generation now excludes unknown HTTP methods from the generated OpenAPI document. In particular, query methods, which are standard HTTP methods but not recognized by OpenAPI, are now gracefully excluded from the generated OpenAPI document.

    This was a community contribution. Thanks @martincostello!

    Improve the description of JSON Patch request bodies

    The OpenAPI schema generation for JSON Patch operations now correctly applies the application/json-patch+json media type to request bodies that use JSON Patch. This ensures that the generated OpenAPI document accurately reflects the expected media type for JSON Patch operations. In addition, the JSON Patch request body has a detailed schema that describes the structure of the JSON Patch document, including the operations that can be performed.

    This was a community contribution. Thanks @martincostello!

    Use invariant culture for OpenAPI document generation

    OpenAPI document generation now uses invariant culture for formatting numbers and dates in the generated OpenAPI document. This ensures that the generated document is consistent and does not vary based on the server's culture settings.

    This was a community contribution. Thanks @martincostello!

    Skip Validation Attribute

    An experimental [SkipValidation] attribute has been added to Microsoft.Extensions.Validation that allows developers to opt out of validation for specific properties, method parameters, or entire types. This provides fine-grained control over validation behavior while maintaining the default validation functionality.

  9. oroztocil commented on Sep 5, 2025

    @oroztocil
    Member

    @mikekistler Just note regarding the Skip Validation Attribute paragraph: I am an FTE in the Blazor team so it probably does not count as a community contribution 🙂

  10. guardrex commented on Sep 5, 2025

    @guardrex
    Collaborator

    @wadepickett @tdykstra ... Because the validation coverage ☝️ applies to Minimal APIs and Blazor, I'm going to place the coverage out in the main What's New article content (not in one of the INCLUDES files). I'll take a shot at getting the reference coverage updated, too. Blazor also has it's own forms validation issue at #35972 that I'll be working at the same time.

    I won't address the OpenAPI work for the [SkipValidation] attribute to avoid my Blazor PR colliding with the one coming up for OpenAPI work. Note in passing tho that the [SkipValidation] attribute coverage for OpenAPI is likely for ...

    https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/openapi/include-metadata.md

  11. javiercn commented on Sep 5, 2025

    @javiercn
    Member

    ✔️ Resolved — PersistentState support on enhanced navigation

    This release introduces fine-grained control over when and how persistent component state (PCS) is restored in Blazor applications, unlocking support for enhanced navigation scenarios. Developers can now configure restoration behavior for properties marked with the [PersistentState] attribute, specifying whether state should be restored during prerendering (initial load), reconnection (resume), or when updates occur as a result of enhanced navigation. The new RestoreBehavior and AllowUpdates options enable scenarios such as restoring state only on initial load, only on resume, or opting-in to receive state updates during enhanced navigation, providing greater flexibility and control over application state management.

    This release adds new types and properties: RestoreOptions, RestoreBehavior, RestoreContext, and the RegisterOnRestoring method for programmatic restoration. These allow developers to precisely define restoration logic, avoid unintended overwrites of user state, and support advanced scenarios such as custom restoration flows or partial state updates. For example, a weather forecast component can now persist data and receive updates only during enhanced navigation, while user drafts or settings can be selectively restored on initial load or reconnection, as needed.

    Overall, these enhancements make it easier to build robust, stateful Blazor applications that behave predictably across prerendering, reconnection, and client-side navigation events. The result is improved resilience for end-user workflows, better support for advanced navigation patterns, and a more flexible foundation for future Blazor features.

    🟢 Example Where AllowUpdates = true Makes Sense

    Scenario: Displaying Cached Data That Doesn’t Change Often

    Imagine a weather forecast page that fetches data from a service and displays it. The data is read-only and doesn’t change frequently. In this case, allowing updates during enhanced navigation is safe and beneficial—it improves performance and user experience by avoiding unnecessary reloads.

    [PersistentState(AllowUpdates = true)]
    public WeatherForecast[]? Forecasts { get; set; }

    protected override async Task OnInitializedAsync()
    {
        Forecasts ??= await ForecastService.GetForecastAsync();
    }

    ✅ Why it works:

    The data is not user-modified.
    Updates from enhanced navigation won’t corrupt or overwrite user input.
    Improves responsiveness by reusing previously fetched data.

    🔴 Example Where AllowUpdates = false Is Preferable

    Scenario: User Is Filling Out a Form

    Suppose you have a form where users enter sensitive or complex data—like a job application or medical intake form. If enhanced navigation triggers a state update, it could overwrite in-progress user input, causing frustration or data loss.

    [PersistentState(AllowUpdates = false)]
    public ApplicationFormModel FormData { get; set; } = new();

    protected override void OnInitialized()
    {
        // Load defaults or previously saved draft
        FormData = LoadDraft() ?? new ApplicationFormModel();
    }

    🚫 Why updates are risky:

    The user may be actively modifying the form.
    Enhanced navigation could restore stale or unintended state.
    Preventing updates ensures user input is preserved until explicitly saved.

    Resolved by #36053. Note that I'm using DR's lingo from the .NET Core notes.

  12. unpinned this issue on Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

aspnet-core/svcrelease-notes/subsvcseQUESTered

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions