You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the suggestion, this was discussed already in #1907 and the decision was to leave it for now. We'll re-visit once we drop support for platforms older than net7. Using a compiled regex as we currently do allows for compilation on all platforms we support without a need for conditional compilation, which I want to avoid.
Visual Studio and Rider actually recommend this change when you drop all frameworks other than .NET 7 and upgrade LangVersion.
This isn't practical as FluentValidation is used in a huge number of codebases. At an absolute minimum we need to support the LTS release (net6) as well as the current release (net7).
We no longer need to support net5 (as this is out of support by MS), but can't be removed without a major version increase, so will continue to be supported in FluentValidation 11, and dropped from FluentValidation 12.
Netstandard support is more complex as there is no end of support date from Microsoft on these, but the plan is to drop netstandard2 in FluentValidation 12 as I don't want to support legacy .NET Framework anymore. Netstandard2.1 support will continue in FluentValidation 12, and we'll re-evaluate for FluentValidation 13. So v13 is the earliest I'd consider switching to regex source generators.
Is your feature request related to a problem? Please describe.
The recommended way of using regular expressions is through source generators.
Describe the solution you'd like
This line (and others like it)
FluentValidation/src/FluentValidation/Internal/MessageFormatter.cs
Line 29 in 1f9102d
can be rewritten as:
This feature is only available in .NET 7 and above and language version 11+, so
NET7_0_OR_GREATER
symbol should be used.Describe alternatives you've considered
No response
Additional Context
Obviously this is very low priority issue, but came across when working on #2136, since this is where we were discussing source generators.
Visual Studio and Rider actually recommend this change when you drop all frameworks other than .NET 7 and upgrade LangVersion.
I can send a PR if you're interested.
The text was updated successfully, but these errors were encountered: