Pin FluentValidation.DependencyInjectionExtensions to 12.1.1 - #3723
Merged
Merged
Conversation
FluentValidation.AspNetCore 11.3.1 pulls in FluentValidation.DependencyInjectionExtensions 11.11.0, whose nuspec misspells its dependency as Microsoft.Extensions.Dependencyinjection.Abstractions (lowercase i). Any restore that doesn't apply .NET 10 package pruning has to resolve that id and fails with NU1102. Add a direct reference at 12.1.1 so it wins over the transitive 11.11.0. This matches FluentValidation, already at 12.1.1 and already overriding the 11.11.0 that FluentValidation.AspNetCore asks for; the two packages are versioned in lockstep upstream. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
gunndabad
enabled auto-merge
August 14, 2026 10:56
hortha
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Builds from Rider have been failing since the last pull from
mainwithNU1102acrossApi,AuthorizeAccess,SupportUi,WebCommonand the test projects that reference them:Note the lowercase
iinDependencyinjection. That id is a typo in the nuspec of FluentValidation.DependencyInjectionExtensions 11.11.0, whichFluentValidation.AspNetCore11.3.1 pulls in transitively:Under .NET 10 package pruning that package is dropped from the graph entirely (the shared framework provides it), so the typo'd id never has to be resolved — which is why
dotnet buildfrom the command line is unaffected, and why nopackages.lock.jsononmaincontains an entry for it. Any restore that doesn't prune has to resolve the id and fails. Rider's in-process NuGet restore is one such restore; it writes the error intoproject.assets.json, andResolvePackageAssetsthen replays it as a build error until something re-restores. That's why Rider builds alternate between clean and failing depending on whether a CLI build ran in between.This is not caused by the SDK pin in #3720 — Rider resolves
10.0.301both before and after it, and restore is clean under 10.0.102, 10.0.301 and 10.0.303 alike.Changes proposed in this pull request
Add a direct
FluentValidation.DependencyInjectionExtensions12.1.1 reference so it wins over the transitive 11.11.0. Version 12.1.1 spells the dependency correctly:No behaviour changes — validation is untouched.
Guidance to review
Why pin rather than drop
FluentValidation.AspNetCore. Dropping it was considered and rejected as too large for this fix. Three of its APIs are load-bearing:AddFluentValidationAutoValidation(validates every API request model),IValidatorInterceptor(PreferModelBindingErrorsValidationInterceptor), andValidationResult.AddToModelState. Removing it means reimplementing MVC auto-validation and changing the 400-response path for the whole public API. Worth doing separately.Upgrading
FluentValidation.AspNetCoreis not an option. It is discontinued — 133 versions published, the last being the 11.3.1 we're on. There is no 12.x and no newer prerelease; the maintainer retired it when auto-validation was dropped in FluentValidation 12.This is consistent with what we already do.
FluentValidation.AspNetCore11.3.1 also asks forFluentValidation11.11.0, and our directFluentValidation12.1.1 already overrides it. The two packages are versioned in lockstep upstream, so leaving DI.Extensions at 11.11.0 while FluentValidation sits at 12.1.1 was the anomaly.Lock file churn is mechanical — 11
packages.lock.jsonfiles now resolve DI.Extensions to 12.1.1.Verification
just build— 0 errors, 0 warnings.just restore(--locked-mode, as CI runs it) — clean.just format-changed— no changes.-p:RestoreEnablePackagePruning=falseto simulate a non-pruning restore like Rider's: the typo'd id no longer appears in the resolved graph at all (was present before this change). This is the direct evidence the Rider failure is fixed.just test-changedwas not run. It aborts before running anything: the script derives aTeachingRecordSystem.WebCommon.Testsproject from the changedWebCommonproject, and no such project exists, so it crashes trying tocdinto it. Pre-existing limitation inscripts/Utils.cs, unrelated to this change, but it means the affected tests are unverified locally and are relying on CI.Checklist
🤖 Generated with Claude Code