Describe the bug Unhandled exception in browser.
To Reproduce Steps to reproduce the behavior: While following the concepts in Chapter 5 of Blazor in action, I am getting this error:
[2021-03-29T21:44:03.980Z] Error: System.MissingMethodException: Method not found: 'System.Collections.Generic.IList`1<FluentValidation.Results.ValidationFailure> FluentValidation.Results.ValidationResult.get_Errors()'.
at Blazored.FluentValidation.EditContextFluentValidationExtensions.ValidateModel(EditContext editContext, ValidationMessageStore messages, IServiceProvider serviceProvider, Boolean disableAssemblyScanning, FluentValidationValidator fluentValidationValidator, IValidator validator)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Blazored.FluentValidation.EditContextFluentValidationExtensions.ValidateModel(EditContext editContext, ValidationMessageStore messages, IServiceProvider serviceProvider, Boolean disableAssemblyScanning, FluentValidationValidator fluentValidationValidator, IValidator validator)
at Blazored.FluentValidation.EditContextFluentValidationExtensions.<>c__DisplayClass3_0.<AddFluentValidation>b__0(Object sender, ValidationRequestedEventArgs eventArgs)
at Microsoft.AspNetCore.Components.Forms.EditContext.Validate()
at Microsoft.AspNetCore.Components.Forms.EditForm.HandleSubmitAsync()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
Frankly, I don’t know where to look to find out why a method would be missing. 😦
Here’s the beginning of the Edit Form.
<EditForm Model="@objNewPerson" OnValidSubmit="@HandleValidSubmit">
<FluentValidationValidator />
<FormSection Title="Personal Info">
Using <DataAnnotationsValidator />
works fine (except I thought it would be easier to use fluent for the child records).
Expected behavior No errors in JS console. Validation error in markup (“Surname is required”)
Hosting Model (is this issue happening with a certain hosting model?):
- Blazor Server
Additional context Following the steps from Blazor in Action, with my own model, that includes a “child” record (Person and PhoneNumbers, rather than Trails and Steps).
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
Sounds good. 10.0 is actually released now, so you may want to publish a new major version release that targets it. I think the only thing you should need to do is recompile against it, but let me know if you run into any issues upgrading.
Thanks for the info @JeremySkinner. I’ll get a limit added for the package and hopefully it should sort things out 👍