-1
我收到以下錯誤,可能是什麼原因。IBodyModelValidator你是否缺少類型映射?
我剛剛創建了一個新的控制器,其他控制器的工作正常。
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;
}
}
可能是我不清楚我的問題,請讓我知道。