首页 新闻 会员 周边 捐助

Unity MVC 2 配置节点报错 The type name or alias UserInfoDAL,MyOfficeDAL could not be resolved. Pleas

0
悬赏园豆:50 [已解决问题] 解决于 2013-09-23 14:24
 1 //这是配子文件
 2 <configSections>
 3         <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration"/>
 4     </configSections>
 5     <unity>
 6     
 7         <alias alias="IUserInfoBLL" type="IMyOfficeBLL.IUserInfoBLL,IMyOfficeBLL" />
 8 
 9     <alias alias="IUserInfoDAL" type="IMyOfficeDAL.IUserInfoDAL,IMyOfficeDAL" />
10     
11         <alias alias="UserInfoDAL" type="MyOffice.UserInfoDAL,MyOfficeDAL"/>
12     
13         <alias alias="UserInfoBLL" type="MyOfficeBLL.UserInfoBLL,MyOfficeBLL"/>
14     
15     <alias alias="UserInfo" type="WebUI.Controllers.UserInfoController,WebUI" />
16     
17         <alias alias="MyOfficeModels" type="MyOfficeModels" />
18         <container name="default">
19             <register type="IUserInfoDAL" mapTo="UserInfoDAL"/>
20             <register type="IUserInfoBLL" mapTo="UserInfoBLL" >
21                 <property name="UserInfo">
22                     <dependency/>
23                 </property>
24             </register>
25       <register type="UserInfo"  mapTo="UserInfo">
26         <property name="bll">
27           <dependency/>
28         </property>
29       </register>
30         </container>
31     </unity>
32 
33 //接口类
34 namespace IMyOfficeDAL
35 {
36     public interface IUserInfoDAL
37     {
38         int VailUser(string name,string pass);
39     }
40 }
41 //实现上面接口类
42 using MyOfficeModels;
43 using IMyOfficeDAL;
44 
45 namespace MyOfficeDAL
46 {
47     public class UserInfoDAL:IUserInfoDAL
48     {
49 
50         #region IUserInfo 成员
51 
52         MyOfficeEntities content = new MyOfficeEntities();
53 
54         //查询数据库是否存在
55         public int VailUser(string name, string pass)
56         {
57             int result = content.UserInfoes.Count(u => u.UserId == name && u.PassWord==pass);
58             return result;
59         }
60 
61         #endregion
62     }
63 }
64 
65   public static void RegisterType()
66         {
67             UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
68             uc.LoadConfiguration(section, "default");
69         }
土匪吃黄瓜的主页 土匪吃黄瓜 | 初学一级 | 园豆:2
提问于:2013-09-23 12:05
< >
分享
最佳答案
0

请仔细看11行(编号11),个人目测有问题。

收获园豆:50
幻天芒 | 高人七级 |园豆:37207 | 2013-09-23 13:03

<alias alias="UserInfoDAL" type="MyOffice.UserInfoDAL,MyOfficeDAL"/>

幻天芒 | 园豆:37207 (高人七级) | 2013-09-23 13:04

@幻天芒:  谢谢 到头还是程序集的问题。

土匪吃黄瓜 | 园豆:2 (初学一级) | 2013-09-23 14:23

@土匪吃黄瓜: 额,这也能遇到...

幻天芒 | 园豆:37207 (高人七级) | 2013-09-23 15:12
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册