.NET 10 RC 1:在 Blazor 中引入持久状态、增强验证以及生产就绪工具

  • Release: Last week, Microsoft announced the release of .NET 10 Release Candidate 1, with the first of two release candidates before the final version. It comes with a go-live license and is available with Visual Studio 2026 Insiders and supported in Visual Studio Code through the C# Dev Kit.
  • ASP.NET Core Features:

    • In Blazor during enhanced navigation, ASP.NET Core introduces support for persistent component state, allowing components to retain and retrieve previously stored state to improve application performance and maintain user progress. Developers can configure the [PersistentState] attribute.
    • ASP.NET Core Identity now emits a set of built-in metrics under the Microsoft.AspNetCore.Identity meter, including duration tracking for user creation and login operations and counters for token generation and two-factor authentication events.
    • Validation improvements span both Minimal APIs and Blazor, with support for type-level validation, the [SkipValidation] attribute, and excluding [JsonIgnore] properties from validation.
    • OpenAPI schema generation has been refined, including modeling nullable complex types with the oneOf construct, improving schema reference handling and including property descriptions. Community contributions have extended support for XML comment metadata and added accurate media types. Unknown HTTP methods are excluded from schema generation.
  • .NET MAUI:

    • In .NET MAUI, the team added diagnostics instrumentation under the Microsoft.Maui source. Layout methods like Measure() and Arrange() generate metrics and activity traces for better performance profiling. New events in HybridWebView allow developers to hook into the embedded browser view lifecycle. The RefreshView control gains an IsRefreshEnabled property for consistent platform behavior.
    • For Android development, experimental support for running applications on the CoreCLR runtime instead of Mono is available by setting UseMonoRuntime to false, but it's not for production use and may have issues like larger binaries or limited diagnostics.
  • Windows Forms: Windows Forms introduces full support for dark mode without experimental flags. The ApplyThemingImplicitly flag in ControlStyles is key for theming behavior. Async methods like ShowAsync and ShowDialogAsync have exited experimental status with improved allocation performance and state management for multiple windows.
  • Entity Framework Core 10:

    • Entity Framework Core 10 brings advancements, such as SQL Server supporting the new vector data type and the VECTOR\_DISTANCE() function for vector-based similarity searches. JSON column support is fully integrated for mapping arrays and nested objects directly into the database. Cosmos DB features are expanded with full-text and hybrid search capabilities.
    • Support for complex types has been improved, allowing mapping of nested objects as JSON or individual columns, and parameterized collection padding is introduced to optimize SQL for large input collections.
  • Documentation: Full technical documentation, samples, and changelogs are available in the official .NET 10 RC1 release notes.
阅读 25
0 条评论