I’ve inherited some code that uses FluentValidation 3.0.0.1 and on my machine that has .NET 4.5 installed I get the scary System.Security.VerificationException : Operation could destabilize the runtime error. After reading this post: http://elegantcode.com/2012/08/23/net-4-5-operation-could-destabilize-the-runtime-yikes/ I updated FluentValidation and FluentValidation.MVC3 nuget packages to newest version 3.4.6.0.
But… after update, this code does not compile:
rules.RuleFor(x => x.Number).DisplayName("Bla bla bla"); // <-- No DisplayName method
It fails because it relays on using FluentValidation.Mvc.MetadataExtensions and this namespace does not exist in DLL instaled with 3.4.6.0
Is there some MetadataExtensions equivalent in newest FV? If not, how can I replace DisplayName, Scaffold, HiddenInput and similar methods with something that works in newest 3.4.6.0?
(I’m completely new to FluentValidation – just stumbled upon it because of VerificationException)
Installation of the newest version was not an option but I’ve downloaded 3.0.0.1 source and applied change to AbstractValidator class.
After replacing original 3.0.0.1 with patched version application starts without
VerificationException.