unity 4 Please check your configuration file and verify this type name.
The problem is in you config file. You are mixing two concepts with some incorrect syntax.
The <assembly... />
and <namespace ... />
nodes provide an assembly and namespace search order when your <register ... />
node contains a type that cannot be found by itself. If a type cannot be found, it searches through all combinations of [namespace].Type, [assembly]
. Here's where the error is: it does NOT search for Type, [assembly]
. If any <namespace ... />
nodes are defined, it does NOT try appending only the assembly.
So your <register type="Biblioteca.Contracts.IManterCategoriaBO" mapTo="Biblioteca.Business.ManterCategoriaBO" />
node has the type Biblioteca.Contracts.IManterCategoriaBO
which does not contain the assembly, so it cannot be found. Therefore, it needs to do a search. You did specify <namespace ... />
nodes, so it will first tryBiblioteca.Biblioteca.Contracts.IManterCategoriaBO, Biblioteca
. Notice the duplicate Biblioteca name.
Here's a corrected config file.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />
</configSections>
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
<assembly name="Biblioteca" />
<assembly name="Biblioteca.Contracts" />
<assembly name="Biblioteca.Business" />
<namespace name="Biblioteca" />
<namespace name="Biblioteca.Contracts" />
<namespace name="Biblioteca.Business" />
<container>
<register type="IManterCategoriaBO" mapTo="ManterCategoriaBO" />
<!-- Or this works -->
<!--<register type="Biblioteca.Contracts.IManterCategoriaBO, Biblioteca" mapTo="Biblioteca.Business.ManterCategoriaBO, Biblioteca" />-->
</container>
</unity>
</configuration>
unity 4 Please check your configuration file and verify this type name.的更多相关文章
- Unity Ioc 类型初始值设定项引发异常,The type name or alias SqlServer could not be resolved. Please check your configuration file and verify this type name.
先看一下unity的配置信息 <unity> <typeAliases> <typeAlias alias="IDatabase" type=&quo ...
- mha安装报错 [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln361] None of slaves can be master. Check failover configuration file or log-bin settings in my.cnf
查找资料 参考 http://blog.51cto.com/16769017/1878451 解决方法: 在两个从库上开启二进制日志即可(花了 一天时间,找不到解决方法,最后还是靠自己的理解及测试解决 ...
- The type name or alias SqlServer could not be resolved.Please check your configuration
The type name or alias SqlServer could not be resolved.Please check your configuration file.... 检查一下 ...
- phpmyadmin Wrong permissions on configuration file, should not be world writable!
巴拉巴拉,实际场景是这样,因为有需要,所以想用django 做个rest服务给其他平台提供服务,发现以前正常的页面都无法运行,奇怪发现有一个页面提示连接不上mysql 难道mysql挂了,打开phpm ...
- How to find configuration file MySQL uses?
http://www.dbasquare.com/2012/04/01/how-to-find-mysql-configuration-file/ A customer called me today ...
- This configuration file was broken by system-config-keyboard
posts • Page of problem with startx Postby evarie » // :: Normally i can get started with the x wind ...
- How to find configuration file MySQL uses?(转)
http://www.dbasquare.com/2012/04/01/how-to-find-mysql-configuration-file/ A customer called me today ...
- 解决Scala Play框架在Git Bash运行的异常:Could not find configuration file ../framework/sbt/sbt.boot.properties
Git Bash+ConEmu可以模拟Linux强大的命令行.不过在结合Scala和Play时,需要注意如下事项: 1. Scala的安装在64位操作系统下,默认会放在“C:\Program File ...
- Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the co
log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFact ...
随机推荐
- LeetCode----Copy List with Random Pointer 深度拷贝,浅度拷贝,Lazy拷贝解析
题目:A linked list is given such that each node contains an additional random pointer which could poin ...
- ModelFirst的CRUD
创建实体:
- 5、SQL基础整理(字符串函数)
字符串函数 ASCII 返回字符串首字母的ascii编码 select ASCII('name') select ASCII(name) from xuesheng select *from xues ...
- HDU 4386
http://acm.hdu.edu.cn/showproblem.php?pid=4386 题意:给四条边长,问能否组成四边形,如果能,求最大面积 求最大面积用海伦公式的四边形推广,p=(a+b+c ...
- linux安装sqlcmd登录sqlserver
首先从微软网站下载sqlncli安装文件,link. 因为是在内网安装,首先手工下载unixODBC2.3.0.tar.gz,下载后上传到服务器. 将下载的tar文件文件,放在同build_dm.sh ...
- 自定义动画方法 animate()
animate方法的语法结构为: animate(params,speed,callback); 参数说明: (1) params:一个包含样式属性及值的映射,比如{property:'value1' ...
- 第六课,T语言表达式(版本5.0)
TC综合开发工具里的表达式大体分为:计算表达式.条件表达式 计算表达式: 它一般是用在赋值过程中,或者是和条件表达式混合使用这样的表达式里只有数字运算符(如:+.-.+=.*=等等运算符),没有关系运 ...
- WebSphere中对response.sendError()的处理与Tomcat不同
不同的地方在于,同样的代码[response.sendError(1);] 在Tomcat下,response.getResponseCode()的值是 1,而在Websphere下面则是 500. ...
- python--迭代--7
原创博文,转载请标明出处--周学伟http://www.cnblogs.com/zxouxuewei/ 一.什么是迭代 在Python中,如果给定一个list或tuple,我们可以通过for循环来遍历 ...
- leetcode 149. Max Points on a Line --------- java
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. ...