Getting a MissingMethodException Cannot create an instance of an interface

Getting a MissingMethodException Cannot create an instance of an interface

Old forum URL: forums.lhotka.net/forums/t/9746.aspx


brafales posted on Thursday, November 11, 2010

Hi,

I'm using CSLA on a MVC2 project. I have a root object (inherits from BusinessBase) that has a list of editable childs (classes inherit from BusinessListBase and BusinessBase).

In the view I use a foreach to traverse the child list and I create a partial view for each child so I can edit all the childs of that collection. However, when I post the data I get this error on this line:

if (TryUpdateModel(day) && day.IsValid) //day here is the root editable object

MissingMethodException Cannot create an instance of an interface

Anyone knows what I'm doing wrong? the class of day inherits from BusinessBase and it's a concrete class, not an interface, and the same goes for the child list.

KodeKat replied on Sunday, February 06, 2011

I got the same exception after adding an 'int' parameter to an action method.

Try putting a break point in the controllers constructor and stepping through from there. I found that one of the other action methods (not the one specified in the forms post arguments) was being called instead.

Copyright (c) Marimer LLC