c# - IBodyModelValidator Are you missing a type mapping? -
i getting below error, reason.
i have created 1 new controller, other controllers working fine.
error: resolution of dependency failed, type = "system.web.http.validation.ibodymodelvalidator", name = "(none)". exception occurred while: while resolving. exception is: invalidoperationexception - current type, system.web.http.validation.ibodymodelvalidator, interface , cannot constructed. missing type mapping? ----------------------------------------------- @ time of exception, container was: resolving system.web.http.validation.ibodymodelvalidator,(none)
and falling @ below line.
public object getservice(type servicetype) { if (this.container == null) { throw new objectdisposedexception("this", "this scope has been disposed."); } try { return this.container.resolve(servicetype); } catch (resolutionfailedexception) { return null; } }
may not clear question, please let me know.
i replaced
using system.web.mvc;
with
using system.web.http;
and worked.
Comments
Post a Comment