Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

Commented Issue: ValidationFailure constructors cause System.Security.VerificationException in unit tests being run with code coverage [7096]

$
0
0
When running any unit test under a code coverage tool (e.g. TestDriven.NET "Test With" NCover or VS Coverage) which contains a call to either of the ValidationResult constructors, I get a System.Security.VerificationException like

Test 'xxx' failed: System.Security.VerificationException : Operation could destabilize the runtime. at FluentValidation.Results.ValidationResult..ctor()

Based on this SO answer: http://stackoverflow.com/a/2883384/236255, it looks like removing the AllowPartiallyTrustedCallers assembly attribute might be the fix in http://fluentvalidation.codeplex.com/SourceControl/changeset/view/58a381d61018#src%2fCommonAssemblyInfo.cs

Thanks.
Comments: I have the same problem but running an asp.net mvc project.

Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>