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: NullReferenceException in FluentValidationClientModelValidatorProvider.CreateValidators(ClientValidatorProviderContext context)

See original GitHub issue

Hi!

In FluentValidationClientModelValidatorProvider.cs lines 40-41 you have the following code:

var validator = _validatorFactory.GetValidator(modelType); var descriptor = validator.CreateDescriptor();

This works fine if you have validator for modelType but what if some models are validated not by FluentValidation but some other validator? ASP.NET MVC allows to have multiple validator implementations in one app.

Unfortunately I can’t open solution to make necessary changes and create pull request by myself. I would be appreciated if somebody could find a few minutes to fix this issue and publish new Nuget packages.

Thank you!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
JeremySkinnercommented, Feb 13, 2017

Aiming for a fix to be out today.

0reactions
JeremySkinnercommented, Oct 24, 2017

@ruslankiskinov Please open a separate issue providing a full stack trace - thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NullReferenceException when using Fluent Validation ASP ...
whenever I hook up fluent validation to my asp.net core mvc app I ... CreateValidators(ClientValidatorProviderContext context) Microsoft.
Read more >
NullReferenceException in 7.2.0 · Issue #585
Hi, I'm running FV 7.20 in a new ASP.NET ... CreateValidators(ClientValidatorProviderContext context) error. ... GetResult() AspNetCore.
Read more >
System.NullReferenceException while trying to load a view
I am trying to load DataMgmt.cshtml view by clicking on a link from my _Layout page but the page which should be loaded...
Read more >
System.NullReferenceException: Object reference not set ...
NullReferenceException means that you are trying to use a reference variable whose value is Nothing/null . When the value is Nothing/null for the...
Read more >
What is NullReferenceException in C#? - Code Maze
In C#, a NullReferenceException occurs when we try to access a variable whose value has not been set or has been set to...
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