views:

30

answers:

0

I have an application that I've been using xVal successfully on for quite some time. It was recently updated to MVC 2.

I use the standard DataAnnotations attributes on my domain models, which also implement a "Validate()" method that calls the DataAnnotationsValidationRunner. If there are any errors, that method throws a RulesException.

In my controllers, I use the very typical catch for RulesException

catch (RulesException e)
{
    e.AddModelStateErrors(ModelState, "err");
}

All typical stuff, nearly straight from the examples, and working fine until recently (I suspect the problems started at the time of my MVC1 -> MVC2 update.

So the problem is this: When the AddModelStateErrors method gets called, I'm getting a "System.EntryPointNotFoundException : Entry point was not found", which is coming from System.Collections.Generic.ICollection1.get_Count() at System.Web.Mvc.Html.ValidationExtensions.ValidationMessageHelper(HtmlHelper htmlHelper, ModelMetadata modelMetadata, String expression, String validationMessage, IDictionary2 htmlAttributes) at System.Web.Mvc.Html.ValidationExtensions.ValidationMessage(HtmlHelper htmlHelper, String modelName, String validationMessage, IDictionary`2 htmlAttributes) at ASP.views_user_edit_aspx.__RenderContent2...{snipped, as it's standard from there}

I've looked at both the code for xVal's method and the HtmlHelper Extension, and I can't seem to figure out what's going on.

Any ideas?