接口没有注册,导致构造的时候出错
今天在做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还没有用