【发布时间】:2015-08-25 10:08:25
【问题描述】:
我遇到错误,可能是什么原因。
我刚刚创建了一个新控制器,其他控制器工作正常。
Error:
Resolution of the dependency failed, type = "System.Web.Http.Validation.IBodyModelValidator", name = "(none)".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The current type, System.Web.Http.Validation.IBodyModelValidator, is an interface and cannot be constructed. Are you missing a type mapping?
-----------------------------------------------
At the time of the exception, the container was:
Resolving System.Web.Http.Validation.IBodyModelValidator,(none)
它落在线以下。
public object GetService(Type serviceType)
{
if (this.Container == null)
{
throw new ObjectDisposedException("this", "This scope has already been disposed.");
}
try
{
return this.Container.Resolve(serviceType);
}
catch (ResolutionFailedException)
{
return null;
}
}
可能我的问题不清楚,请告诉我。
【问题讨论】:
标签: c# model-view-controller asp.net-web-api