今天在做MVC项目的时候,使用微软企业库的缓存接口icachemanager,抛出如下异常
The current type, Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager, is an interface and cannot be constructed. Are you missing a type mapping?
经过检查,发现要在webconfig里面注册
<configSections>
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching" requirePermission="false"/>
光using还没有用
本文介绍了解决在MVC项目中使用微软企业库的ICacheManager接口时遇到的构造异常问题。通过在web.config文件中正确配置cachingConfiguration部分,可以避免因缺少类型映射而引发的错误。
1033

被折叠的 条评论
为什么被折叠?



