统一映射问题 - 异常是:InvalidOperationException [英] unity mapping issue - Exception is: InvalidOperationException

查看:104
本文介绍了统一映射问题 - 异常是:InvalidOperationException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

依赖项的解析失败,type =StudentManagement.IBusiness.ILoggManager,name =(none)。

异常发生时:解析时。

例外情况是:InvalidOperationException - 当前类型StudentManagement.IBusiness.ILoggManager是一个接口,无法构造。你错过了类型映射吗?

----------------------------------- ------------

在例外情况下,容器是:



解决学生管理问题。 IBusiness.ILoggManager,(无)



任何解决方案?

我提供了映射,所有其他映射都正常工作。< br $>


container.RegisterType< iloggmanager,>();

解决方案

无法实例化接口。您必须指定一个类作为泛型类型,另请参阅 http://msdn.microsoft.com/en -us / library / ff648211.aspx [ ^ ]

Resolution of the dependency failed, type = "StudentManagement.IBusiness.ILoggManager", name = "(none)".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The current type, StudentManagement.IBusiness.ILoggManager, is an interface and cannot be constructed. Are you missing a type mapping?
-----------------------------------------------
At the time of the exception, the container was:

Resolving StudentManagement.IBusiness.ILoggManager,(none)

Any solution to this??
I have provided mapping as and all other mappings are working.

container.RegisterType<iloggmanager,>();

解决方案

Interfaces cannot be instantiated. You have to specify a class as the generic type, see also http://msdn.microsoft.com/en-us/library/ff648211.aspx[^]


这篇关于统一映射问题 - 异常是:InvalidOperationException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆