Skip to content

[release/11.0] Replace IValidationMessageFormatter with ValidationAttribute.FormatMessage - #69116

Open
github-actions[bot] wants to merge 1 commit into
release/11.0from
backport/pr-69027-to-release/11.0
Open

[release/11.0] Replace IValidationMessageFormatter with ValidationAttribute.FormatMessage#69116
github-actions[bot] wants to merge 1 commit into
release/11.0from
backport/pr-69027-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Backport of #69027 to release/11.0

/cc @oroztocil

Drops the MEV-specific IValidationMessageFormatter interface in favor of the equivalent BCL API.

Description

Microsoft.Extensions.Validation (MEV) added IValidationMessageFormatter in #67987 (approved in #66392) so that custom validation attributes could inject attribute-specific arguments into localized error message templates.

Since then, a functionally equivalent API was approved and added directly to the ValidationAttribute base class in the BCL: ValidationAttribute.FormatMessage(string format, string name) (proposal dotnet/runtime#132605, implementation dotnet/runtime#132853). Because it serves the same need at a lower layer, this change removes the MEV interface and calls the base class method instead.

Customer Impact

IValidationMessageFormatter is new in .NET 11 and has not shipped in a stable release. This change means we avoid shipping two overlapping mechanisms for the same purpose and it removes the need for custom validation attributes to reference the MEV namespace.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

The removed interface has not shipped stable, and the replacement is a drop-in. The change is confined to the validation localization path and is covered by existing automated tests.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@github-actions
github-actions Bot requested a review from a team as a code owner September 8, 2026 12:40
@oroztocil oroztocil added Servicing-consider Shiproom approval is required for the issue area-blazor Includes: Blazor, Razor Components feature-validation Issues related to model validation in minimal and controller-based APIs labels Sep 8, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hi @github-actions[bot]. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

@artl93 artl93 removed their assignment Sep 8, 2026
@artl93
artl93 self-requested a review September 8, 2026 23:40

@artl93 artl93 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

New in .NET 11. Completing features. Approved.

@artl93 artl93 added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Sep 8, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hi @github-actions[bot]. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

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

Labels

area-blazor Includes: Blazor, Razor Components feature-validation Issues related to model validation in minimal and controller-based APIs Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants