question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ASP.NET Core 3 Support

See original GitHub issue

ASP.NET Core 3 preview 1 has several breaking changes that prevent FluentValidation from compiling:

  • ValidatorCache has moved namespaces
  • The RequireAttributeAdapter class is no longer public

The namespace move for ValidatorCache means we can’t target 2.x and 3.x with the same build. We’ll either need to drop 2.x support or move to separate packages for supporting 2.x and 3.x. Edit: Looks like we can still use the same package for both as going forward the version of aspnetcore that will be used is tied to the TargetFramework, meaning that we can multi-target with conditional compilation.

The second issue should be resolved for preview 2 - RequireAttributeAdapter has already been made public again in the repository (see https://github.com/aspnet/AspNetCore/pull/4493). Workaround for now is to check for AttributeAdapterBase<RequiredAttribute>.

Will re-evaluate with preview 2.

To-do:

  • Add multi-targetting and conditional compilation to handle the ValidatorCache namespace change
  • For Preview 1: Replace RequiredAttributeAdapter check with AttributeAdapterBase<RequiredAttribute>
  • For preview 2: Put the RequiredAttributeAdapter check back again once it’s public
  • Update the aspnetcore test project to add a new target for netcoreapp3 with appropriate FrameworkReference
  • Investigate test failures Edit: This was a breaking change. The test project needs to explicitly import the Razor SDK so that views are compiled at build time. Relying on runtime view compilation no longer seems to work in test projects without the razor sdk.
  • preview 4: Remove uses of IHostingEnvironment
  • preview 4: Investigate razor build failures yet again (edit: Razor sdk project now needs <AddRazorSupportForMvc>True</AddRazorSupportForMvc>. Web sdk projects don’t need this)
  • preview 4: Investigate routing issues in test project. Edit: Endpoint routing is incompatible with app.UseMvc(). Disabled endpoint routing for backwards compat with tests on other frameworks.
  • For preview 5, investigate if <DepsFileGenerationMode>old</DepsFileGenerationMode> can be removed from the integration test project

Update 10 May: I’ve pushed FluentValidation.AspNetCore 8.5.0-preview1 to nuget. This supports ASP.NET Core 3 preview 5.

TODO for asp.net core 3 preview 7:

  • Switch to System.Text.Json for serialization in integration tests.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:24 (13 by maintainers)

github_iconTop GitHub Comments

11reactions
JeremySkinnercommented, May 10, 2019

I’ve pushed FluentValidation.AspNetCore 8.5.0-preview1 to nuget. This supports ASP.NET Core 3 preview 5.

6reactions
JeremySkinnercommented, May 7, 2019

No breaking changes between asp.net core 3 preview4 and preview5 that affect FluentValidation. As this is starting to seem a bit more stable I’ll aim to push out a preview build at some point later this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

.NET and .NET Core official support policy
Long Term Support (LTS). LTS releases are supported for three years after the initial release. · Standard Term Support (STS). STS releases are...
Read more >
Microsoft .NET and .NET Core - Microsoft Lifecycle
Version Start Date End Date .NET 7 Nov 8, 2022 .NET 6.0 (LTS) Nov 9, 2021 Nov 12, 2024 .NET 5.0 Nov 10, 2020 May 10,...
Read more >
Microsoft .NET - endoflife.date
NET Core 3.1, these releases will happen every November and every other release will be LTS. LTS releases are supported for three years ......
Read more >
Microsoft Announces End of Support Date for .NET Core 3.1
NET 5 and 6, will reach its end of support on December 13, 2022. “.NET Core 3.1 will reach [the] end of support...
Read more >
Microsoft urges devs to migrate away from .NET Core 3.1 ...
Microsoft has urged developers still using the long-term support (LTS) release of .NET Core 3.1 to migrate to the latest .NET Core versions ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found