0

I have a NancyFx project that references another project that contains all my FluentValidation AbstractValidator instances.

That validation project also references NancyFx.Validation.FluentValidation, however none of the Validators I placed in there are picked up by NancyFx when calling BindToAndValidate - the model is always Valid even though.. well.. it is not (according to the corresponding AbstractValidator logic).

Apparently the module's / NancyFx ValidatorLocator does not pick up those separate validators automatically but is there any way (bootstrapper or so) to tell NancyFx to also scan that separate validation assembly? And/or am I missing something here?

Jörg Battermann
  • 4,044
  • 5
  • 42
  • 79

1 Answers1

2

Well it is related to an issue reported already (see https://github.com/NancyFx/Nancy/issues/1287) and if you think about it, it does make sense that it's a "hard" thing to do to scan all assemblies for potential validators.

Nevertheless, there are workarounds mentioned in the issue that do work: manually trigger the assembly loading, move validators into the project itself, etc.

Jörg Battermann
  • 4,044
  • 5
  • 42
  • 79