Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6201713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:36:16+00:00 2026-05-24T04:36:16+00:00

Whenever I run either of the following unit test with a debugger attached, I

  • 0

Whenever I run either of the following unit test with a debugger attached, I get a VerificationException inside FluentValidation code at this point (will post whole stacktrace later if necessary):

at FluentValidation.Resources.LocalizedStringSource.CreateFromExpression(Expression`1 expression, IResourceAccessorBuilder resourceProviderSelectionStrategy)
in ...\FluentValidation\Resources\LocalizedStringSource.cs:line 66

The tests are:

using FluentValidation;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
public class UnitTest1
{
    [TestMethod]
    public void TestMethod1()
    {
        var c = new MyClass();
        var v = new MyValidator();
        v.Validate(c);
    }

    [TestMethod]
    public void TestMethod2()
    {
        Exception ex = null;
        var done = new ManualResetEvent(false);
        ThreadPool.QueueUserWorkItem(
            o =>
            {
                try
                {
                    TestMethod1();
                }
                catch (Exception e)
                {
                    ex = e;
                }
                finally
                {
                    done.Set();
                }
            });

        done.WaitOne();
        Assert.IsNull(ex);
    }
}

public class MyValidator : AbstractValidator<MyClass>
{
    public MyValidator()
    {
        RuleFor(c => c.MyProperty).GreaterThan(0);
    }
}

public class MyClass
{
    public int MyProperty { get; set; }
}

I’ve referenced just these assemblies in a single-solution, single-project scenario, targeting the 4.0.30319 runtime:

  • FluentValidation v3.0.0.0
  • Microsoft.VisualStudio.QualityTools.UnitTestFramework v10.0.0.0
  • System
  • System.Core

Some other points:

  • Running the test without a debugger works fine
  • Code coverage is turned off
  • I’ve minimized the referenced assemblies down to the minimum
  • I don’t see any errors in the Fusion log
  • I tried applying the SecurityRulesAttribute from the answer to a similar question
  • I tried some things from a blog post on VerificationException and testing
  • Occurs under both MSTest and Resharper hosts (haven’t tried NUnit, because the common thread seems to be ‘under debugger’.
  • Occurs when running VS as admin or non-admin

Does anyone know how I can prevent this VerificationException, work around it, and/or why it’s being caused? It seems with so few assemblies, there shouldn’t be any conflicting ones loading. I’ve also moved the FluentValidation satellite assemblies out of the way but still get the exception.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:36:17+00:00Added an answer on May 24, 2026 at 4:36 am

    Ok, I’ve got it. First I’d like to acknowledge Jeremy Skinner for working with me to reproduce the problem. His help spurred me to try tweaking my environment further.

    To prevent the problem you either have to disable IntelliTrace in Visual Studio 2010 Ultimate, or you have to add FluentValidation to the list of modules that IntelliTrace should exclude from collecting data. My web searches seem to indicate it’s an IntelliTrace bug. Jim Nakashima in his blog post says:

    The issue is that IntelliTrace itself has a bug where methods that have a boolean out parameter in an assembly that is marked as SecurityTransparent will fail when IntelliTrace collection is set to “high” which is the default in the Cloud IntelliTrace scenario.

    You will see this in your own code if you have a method whose signature includes a boolean out parameter and you have set your assembly security to SecurityTransparent.

    I looked at my stack trace and briefly through the FluentValidation source, but didn’t see this. I suspect it might be a similar IntelliTrace instrumentation bug relating to LINQ expressions.

    Anyway, here’s how to fix the issue:

    1. In VS, select Debug | Options And Settings… | IntelliTrace | Modules
    2. In the following dialog, click Add… and enter FluentValidation into the text box.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Whenever i try to run sqlmetal, i get this: 'sqlmetal' is not recognized as
Why whenever I compile and run the following code in Visual Studio 2008: double
Is there a feasible way to get my own code run whenever any class
Whenever I run any jython program in Eclipse, I got the following error in
Whenever I run my program, I get: NullReferenceException was unhandled, Object Reference not set
I want code to run whenever I create a new object. For example, see
whenever i run the code below it occurs to me I have made a
Whenever I run vm.runInThisContext(code, filename) , the code I ran reports __filename and __dirname
Whenever I run rake spec, there's a 70-80% chance that I get a SEGMENTATION_FAULT
Whenever I run large scale monte carlo simulations in S-Plus, I always end up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.