Skip to content

Unified validation APIs moved to extensions package - DocsΒ #35744

@tdykstra

Description

@tdykstra

See #35602 (comment)

Move this new .NET 10 release note information into dotnet/aspnetcore.docs articles where needed:
https://raw.githubusercontent.com/dotnet/AspNetCore.Docs/refs/heads/main/aspnetcore/release-notes/aspnetcore-10/includes/validation-package-move.md

Associated WorkItem - 449508

[Extended instructions provided by wadepickett to help copilot make a draft, AI assisted:]

Solution for Issue #35744

Implementation Plan

  1. Create the include file above at /aspnetcore/includes/validation-package-net10.md which should have something similar to the following markdown:
    Start markdown for aspnetcore/includes/validation-package-net10.md

Validation in .NET 10

In .NET 10, the unified validation APIs have been moved to the Microsoft.Extensions.Validation NuGet package. This change makes the validation APIs available outside of ASP.NET Core HTTP scenarios.

To use the Microsoft.Extensions.Validation APIs:

  • Add the following package reference:

    <PackageReference Include="Microsoft.Extensions.Validation" Version="10.0.0" />

    The functionality remains the same but now requires an explicit package reference.

  • Register validation services with dependency injection:

builder.Services.AddValidation();
End markdown for aspnetcore/includes/validation-package-net10.md

The key files to update with the  `/aspnetcore/includes/validation-package-net10.md` include are:
   - `/aspnetcore/mvc/models/validation.md` (main validation documentation)
   - `/aspnetcore/tutorials/first-mvc-app/validation.md` (using moniker range for .NET 10)
   - `/aspnetcore/tutorials/razor-pages/validation.md` (using moniker range for .NET 10)

3. For moniker-based documentation, add a section like:

   ```markdown
   :::moniker range=">= aspnetcore-10.0"
   [!INCLUDE[](~/includes/validation-package-net10.md)]
   :::



Metadata

Metadata

Labels

10.0.NET 10Pri1seQUESTeredIdentifies that an issue has been imported into Quest.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions