I'm using FluentValidation 3.4.6, and the target framework of my project is .net 4. I've checked my solution thoroughly to ensure there are no references to older versions of FluentValidation.
I believe this version of FluentValidation has a work-around for a reflection bug introduced in .NET 4.5, however I'm still getting a VerificationException, as described here http://elegantcode.com/2012/08/23/net-4-5-operation-could-destabilize-the-runtime-yikes/
VerificationException is thrown at this point:
MyValidator : AbstractValidator<MyObj>
ctor {
RuleFor(x => x.SomeProperty).Equal(true);
}
at FluentValidation.Resources.LocalizedStringSource.CreateFromExpression(Expression`1 expression, IResourceAccessorBuilder resourceProviderSelectionStrategy) in c:\projects\FluentValidation\src\FluentValidation\Resources\LocalizedStringSource.cs:line 66
at FluentValidation.Validators.PropertyValidator..ctor(Expression`1 errorMessageResourceSelector) in c:\projects\FluentValidation\src\FluentValidation\Validators\PropertyValidator.cs:line 46
at FluentValidation.Validators.EqualValidator..ctor(Object valueToCompare, IEqualityComparer comparer) in c:\projects\FluentValidation\src\FluentValidation\Validators\EqualValidator.cs:line 37
at FluentValidation.DefaultValidatorExtensions.Equal[T,TProperty](IRuleBuilder`2 ruleBuilder, TProperty toCompare, IEqualityComparer comparer) in c:\projects\FluentValidation\src\FluentValidation\DefaultValidatorExtensions.cs:line 143
at MyValidator..ctor() in MyValidator.cs:line 22
I was able to run outside the debugger and eventually narrowed it down to intell-trace. Disable intelli-trace if you hit this issue in 3.4.6.