现在的位置: 首页 > 综合 > 正文

企业库5.0——缓存使用说明(及初级错误解决)

2014年01月02日 ⁄ 综合 ⁄ 共 866字 ⁄ 字号 评论关闭

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

问题1:未能加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)

原因:PublicKeyToken=31bf3856ad364e35时,DLL是有数字签名的,但如果引用自己生成的DLL就不匹配了,因为安装生成的DLL是签了名的。

解决:添加 Enterprise Library Caching Application Block 和 Enterprise Library Shared Library (如果企业库安装正确引用中会有企业库的引用)

如果没有看看这个位置:C:\Program Files\Microsoft Enterprise Library 5.0\Bin\

 

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

问题2:The current type, Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager, is an interface and cannot be constructed. Are you missing a type mapping?

原因:没有在 config 中配置缓存设置节点

解决:在开始菜单找到:开始\Microsoft patterns & practices\Enterprise Library 5.0\Enterprise Library Configuration\EntLib Config .NET 4

保存一个默认的配置就可以了,设置完后保存设置,之后找到保存的config 文件,将里面内容拷贝到应用程序 config 指定节点就可以了)!

 

 

抱歉!评论已关闭.