public static void RegisterType() { UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity"); section.Containers[0].Configure(uc); } 报错 给定程序集名称或基本代码无效。 <unity> <alias alias="IUserInfoBLL" type="IMyOfficeBLL.IUserInfoBLL,IMyOfficeBLL" /> <alias alias="IUserInfoDAL" type="IMyOfficeDAL.IUserInfoDAL,IMyOfficeDAL" /> <alias alias="UserInfoDAL" type="MyOfficeDAL.UserInfoDAL,MyOfficeDAL"/> <alias alias="UserInfoBLL" type="MyOfficeBLL.UserInfoBLL,MyOfficeBLL"/> <alias alias="UserInfo" type="WebUI.Controllers.UserInfoController,WebUI" /> <alias alias="IMyNoteBLL" type="IMyNoteBLL.IMyNoteBLL,IMyOfficeBLL"/> <alias alias="IMyNoteDAL" type="IMyOfficeDAL.IMyNoteDAL,IMyOfficeDAL"/> <alias alias="MyNoteBLL" type="MyOfficeBLL.MyNoteBLL,MyOfficeBLL"/> <alias alias="MyNoteDAL" type="MyOfficeDAL,MyNoteDAL,MyOfficeDAL" /> <alias alias="MyNote" type="WebUI.MyNoteController,WebUI"/> <container name="mynote"> <register type="IMyNoteDAL" mapTo="MyNoteDAL"/> <register type="IMyNoteBLL" mapTo="MyNoteBLL"> <property name="Dal"> <dependency/> </property> </register> <register type="MyNote" mapTo="MyNote"> <property name="BLL"> <dependency/> </property> </register> </container> <container name="userinfo"> <register type="IUserInfoDAL" mapTo="UserInfoDAL"/> <register type="IUserInfoBLL" mapTo="UserInfoBLL" > <property name="Dal"> <dependency/> </property> </register> <register type="UserInfo" mapTo="UserInfo"> <property name="BLL"> <dependency/> </property> </register> </container> </unity> 所有的程序集我重新生成 检查过 手动复制到WEB 程序的BIN文件下 还是一直报这个错
<alias alias="MyNoteDAL" type="MyOfficeDAL,MyNoteDAL,MyOfficeDAL" />
注意细节。(alias倒数第二行)
好吧。。。。。
写这玩意写的头晕了。。。
再次感谢
@土匪吃黄瓜: 写多了就习惯了。