AspNetCore 9.0.0 'GetValidationVisitor' in type 'FluentValidation.AspNetCore.FluentValidationObjectModelValidator' does not have an implementation
See original GitHub issueWhich version of FluentValidation are you using? FluentValidation.AspNetCore 9.0.0 in an AspNet Core 3.1 project and FluentValidation 9.0.0 in a Netstandard 2.1 project.
Which version of ASP.NET are you using? API Project with AspNet Core 3.1 referencing a project with Netstandard 2.1. This is due to the use of Blazor in a seperate project which we want to be able to share code with the server. The Blazor Project uses Netstandard 2.1.
Describe the issue that you’re having The following exception is thrown during startup of the API-Project.
System.TypeLoadException: 'Method 'GetValidationVisitor' in type 'FluentValidation.AspNetCore.FluentValidationObjectModelValidator' from assembly 'FluentValidation.AspNetCore, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7de548da2fbae0f0' does not have an implementation.'
I am aware that it states the version 8.0.0.0 even though I am sure it should state 9.0.0.0 since it is not an 8.x release. However this is what it seems to load.
I have tried manually purging the nuget packages as well as deleteing all “bin” and “obj” folders in the Project and restoring the packages after. This to make sure I am not having an older package version around that is conflicting (unless I have overlooked another possible source where it could have been loaded from)
Downgrading all FluentValidation(.*) to 8.6.2 in all projects fixes the issue. However we would like to use the latest and greatest 9.0.0 version 😛 So to be clear this issue isn’t time critical to us but I am putting this information/report out there in case it helps you or other users of this package diagnose future issues. I tried upgrading all to 9.0.0 again after this but then I am getting the same error again.
Any Ideas / Help / Fixes for this?
Regards Lukas
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
No worries, glad you got it sorted
So you were right it was me at fault.
I completely overlooked that the API-Project was “Asp.Net Core 3.0” not “Asp.Net Core 3.1”. I must have just looked at the number 3 and adding a 1 to it in my mind since I looked at this information a bunch. Upgrading to Asp.Net Core 3.1 resolves the issue. As the update notes state 3.0 support has been removed. Rightfully so.
Thank you for taking time out of your day to help me out. I must apologise for having overlooked that particular but not less important detail.
I close the issue now.
Kind regards Lukas