Skip to content

Upgrading FluentValidation 10 to 11

Breaking10.4.0 → 11.12.0Breaking7Deprecated12New36Changed34Fixed32Other4

BreakingUpgrade verdict

7 breaking changes.

  • The old OnFailure and OnAnyFailure callbacks are gone; use the newer equivalents.
  • The old ASP.NET setting for running default MVC validation after FluentValidation is removed.
  • The old Options property on RuleComponent is removed.
  • Old testing helper methods that were marked deprecated are removed.
Top 5 of 19 that need code or config changes

Target frameworks requirement changed in 11.9.0: .NETStandard2.0, .NETStandard2.1, net5.0, net6.0 → .NETStandard2.0, .NETStandard2.1, net5.0, net6.0, net7.0, net8.0.

Adds system.threading.tasks.extensions 4.5.4.

Breaking7
Removes the deprecated OnFailure/OnAnyFailure callbacks.
OnFailureOnAnyFailure
Removes the deprecated RunDefaultMvcValidationAfterFluentValidationExecutes option from the ASP.NET integration.
RunDefaultMvcValidationAfterFluentValidationExecutes
Removes the deprecated Options property from RuleComponent.
RuleComponent.OptionsRuleComponent
Removes deprecated TestHelper methods.
TestHelper
Removes the non-generic PropertyValidator backwards compatibility layer.
PropertyValidator
Throws exceptions when an async validator is invoked synchronously.
Throws exceptions when an async validator is invoked synchronously.
Deprecated12
Deprecates disabling the root model null check by overriding AbstractValidator.EnsureInstanceNotNull.
AbstractValidator.EnsureInstanceNotNull
Deprecates the Transform and TransformAsync methods.
TransformTransformAsync
Deprecates the ScalePrecision validator and introduces PrecisionScale as its replacement.
ScalePrecisionPrecisionScale
Deprecates the ScalePrecision validator and introduces PrecisionScale as its replacement.
ScalePrecisionPrecisionScale
Deprecates implicit validation of child properties in MVC auto validation.
Deprecates implicit validation of root collection elements in MVC auto validation.
Deprecates InjectValidator.
InjectValidator
Deprecates IValidatorFactory and ServiceProviderValidatorFactory.
IValidatorFactoryServiceProviderValidatorFactory
Deprecates implicit validation of child properties in MVC auto validation.
Deprecates implicit validation of root collection elements in MVC auto validation.
Deprecates InjectValidator.
InjectValidator
Deprecates IValidatorFactory and ServiceProviderValidatorFactory.
IValidatorFactoryServiceProviderValidatorFactory