FluentValidation not using my Rules
<p>I'm using FluentValidation with Autofac and ValidatorFactoryBase</p>

<p>When I execute my project my Validator is executed, but when I send a post my rules not is used but the current validator is my own Validator.</p>

<p>My Validator:</p>

<pre><code>public class UsuarioCadastrarValidator : AbstractValidator&lt;UsuarioCadastrarVM&gt;
{
    public UsuarioCadastrarValidator()
    {
        RuleFor(a =&gt; a.Nome).NotEmpty().WithMessage("Campo obrigatório");

        RuleFor(a =&gt; a.Nome).Length(4, 200).WithMessage("Digite seu nome completo");
    }
}
</code></pre>

<p>My Model:</p>

<pre><code>public class UsuarioCadastrarVM
{
    public string Nome { get; set; }
    public int CargoId { get; set; }
}
</code></pre>

<p>Global.asax(Works well):</p>

<pre><code>...
    FluentValidationModelValidatorProvider.Configure();


            var assembly = Assembly.GetExecutingAssembly();

            builder.RegisterAssemblyTypes(assembly)
                   .Where(t =&gt; t.Name.EndsWith("Validator"))
                   .AsImplementedInterfaces()
                   .InstancePerLifetimeScope();


            builder.RegisterAssemblyTypes(assembly);

            builder
            .RegisterType&lt;FluentValidation.Mvc.FluentValidationModelValidatorProvider&gt;()
            .As&lt;ModelValidatorProvider&gt;();

            builder.RegisterType&lt;AutofacValidatorFactory&gt;().As&lt;IValidatorFactory&gt;().SingleInstance();

            var container = builder.Build();
            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
...
</code></pre>

<p>Controller(Works well):</p>

<pre><code>[HttpPost]
public ActionResult Cadastrar(UsuarioCadastrarVM vm)
{
      if(ModelState.IsValid)
      {

      }
}
</code></pre>

<p>My ValidatorFactoryBase (Works well):</p>

<pre><code>public class AutofacValidatorFactory : ValidatorFactoryBase
{
    private readonly IComponentContext _context;

    public AutofacValidatorFactory(IComponentContext context)
    {
        _context = context;
    }

    public override IValidator CreateInstance(Type validatorType)
    {
        object instance;
        if (_context.TryResolve(validatorType, out instance))
        {
            var validator = instance as IValidator;
            return validator;
        }

        return null;
    }
}
</code></pre>

<p>When I send Post with "Nome" and "CargoId" empty in ModelState has only one message "CargoId is required" and not exists that Rule, I think is because CargoId is a integer.</p>

<p>But, Why my Rules are not consider?</p>