views:

226

answers:

1

I have just updated to RC1 MVC from the beta product.

I have the following code in my Application_start (in the global.ascx)

System.Web.Mvc.ModelBinders.Binders[typeof(Shared.DO.Gig)] = new GigModelBinder();

This results in the following exception....

Method not found: 'System.Collections.Generic.IDictionary`2 System.Web.Mvc.ModelBinders.get_Binders()'.

A: 

Have you re-built your project. Binders is a ModelBinderDictionary, its not a IDictionary, quite possibly it was before RC1.

AnthonyWJones
Yeah - I rebuilt. How are we supposed to register the Binders now?
ListenToRick
The code looks ok to me assuming GigModelBinder implements IModelBinder. The error you were getting indicated an older definition of ModelBinders was being used.
AnthonyWJones
Do you nean that my ModelBinders themselves (i.e. GigModelBinder) is out of date? They are in the format defined in the beta version of MVC?
ListenToRick
I don't know what you GigModelBinder does or how its built so I can't tell whether its out-of-date. All I do know at this point is the definition of ModelBinders property has changed. If your binder implements IModelBinder that line of code should work.
AnthonyWJones