False fluent validation error goes away after IIS restart
<p>In my ASP.NET MVC application, I use Fluent Validation to validate my models.Please take a look at my model:</p>

<pre><code>[Table("INWARDDOCUMENTS")]
public class InwardDocument{
    .......................
    [Column("DOCDATE")]
    [DisplayFormat(DataFormatString = "{0:dd.MM.yyyy}"),Display(Name="Document date")]
    public DateTime? DocDate { get; set; }
    ........................
}
</code></pre>

<p>And here's the fluent validation part:</p>

<pre><code> RuleFor(doc =&gt; doc.InwardDocument.DocDate.Value.Date).LessThanOrEqualTo(DateTime.Now.Date).When(x=&gt;x.InwardDocument.DocDate!=null).WithMessage("Document date cannot be greater than the current date");
</code></pre>

<p>Overall it works fine, but in average every 3 weeks I get this validation error although the model value is correctly entered. As you can see, I compare the date part of the model with the date part of today, if a date is entered. So no hours or minutes are involved. I enter the same information in debug mode and don't receive this validation error. The only cure is to restart the IIS. Just that is enough to have the problem go away. Any idea why?</p>