Activation error occured while trying to get instance of type ICacheManager. Every few hours or days I received this error. RRS feed

  • Question

  • I am getting error "Activation error occured while trying to get instance of type ICacheManager" after every few hours or days. I have set all settings in config file like providername and etc suggested from google link.

    Everytime I need to clear chache table ato remove this error.
    Can any one help me to find the cause of this.

    Following is the error 

    "Activation error occured while trying to get instance of type ICacheManager, key "CacheManagerPsychic""
    "   at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
       at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService](String key)
       at Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory.InnerGetCacheManager(String cacheManagerName)

    Thanks in advance.

    Tuesday, February 9, 2016 6:51 AM


  • Hi Soruav,

    I guess this issue was caused by the incorrect usage of CacheManager class. The same error message was thrown when you are using CacheManager in Client Apps.

    >> I have set all settings in config file like providername and etc suggested from google link.

    Yes, one solution is to provide configuration in app or web configuration file. Have you tried the following configuration?

            <section name="cachingConfiguration" 
                     type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
        <cachingConfiguration defaultCacheManager="MyCacheManager">
               <add name="MyCacheManager" type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
                    backingStoreName="NullBackingStore" />
                <add type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
                     name="NullBackingStore" />

    Another point, it is recommend use System.Runtime.Caching namespace to provide similar functionality. I guess you would change to use MemoryCache class in Client APP.

    If you are using Web APP and see this error message, I would recommend you post a new thread on forum for effective response.

    I hope it helps.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, February 10, 2016 6:15 AM