1

I have a sitecore commerce site in my local machine and when I click the 'Book Now' button on the website, it shows this error message:

GetCurrentCart: Activation error occured while trying to get instance of type ICacheManager, key "Sitecore_CommerceCartCache"

enter image description here

The commerceengine site which is in the same machine is also up. I tried restarting IIS but no luck.

These are the registered logs:

ERROR Commerce Server: Error retrieving the Cache Manager. Message: Activation error occured while trying to get instance of type ICacheManager, key "Sitecore_CommerceCartCache" 15084 13:05:52 ERROR GetCurrentCart failed Exception: Microsoft.Practices.ServiceLocation.ActivationException Message: Activation error occured while trying to get instance of type ICacheManager, key "Sitecore_CommerceCartCache" Source: Sitecore.Commerce.Connect.CommerceServer at Sitecore.Commerce.Connect.CommerceServer.Caching.EnterpriseLibraryCacheProvider.GetCache(String prefix, String cacheName, String& actualCacheName) at Sitecore.Commerce.Connect.CommerceServer.Caching.EnterpriseLibraryCacheProvider.GetData[T](String prefix, String cacheName, String cacheKey) at Sitecore.Foundation.Commerce.Website.Util.CartCacheHelper.GetCart(String customerId) in D:\Projects\External\DC Ecomm\sitecore.demo.retail\src\Foundation\Commerce\Website\Sitecore.Foundation.Commerce.Website\Util\CartCacheHelper.cs:line 65 at Sitecore.Feature.Commerce.Orders.Website.Controllers.CartController.GetCurrentCart() in D:\Projects\External\DC Ecomm\sitecore.demo.retail\src\Feature\Orders\Website\Sitecore.Feature.Commerce.Orders.Website\Controllers\CartController.cs:line 139

Nested Exception

Exception: Microsoft.Practices.Unity.ResolutionFailedException Message: Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager", name = "Sitecore_CommerceCartCache". Exception occurred while: while resolving. Exception is: InvalidOperationException - The current type, Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager, is an interface and cannot be constructed. Are you missing a type mapping? ----------------------------------------------- At the time of the exception, the container was:

Resolving Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager,Sitecore_CommerceCartCache

Source: Microsoft.Practices.Unity at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides) at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)

Nested Exception

Exception: System.InvalidOperationException Message: The current type, Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager, is an interface and cannot be constructed. Are you missing a type mapping? Source: Microsoft.Practices.Unity at Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.ThrowForAttemptingToConstructInterface(IBuilderContext context) at BuildUp_Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager(IBuilderContext ) at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context) at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)

1584 13:05:53 ERROR Commerce Server: Error retrieving the Cache Manager. Message: Activation error occured while trying to get instance of type ICacheManager, key "Sitecore_CommerceCartCache" 1584 13:05:53 ERROR GetCurrentCart failed Exception: Microsoft.Practices.ServiceLocation.ActivationException Message: Activation error occured while trying to get instance of type ICacheManager, key "Sitecore_CommerceCartCache" Source: Sitecore.Commerce.Connect.CommerceServer at Sitecore.Commerce.Connect.CommerceServer.Caching.EnterpriseLibraryCacheProvider.GetCache(String prefix, String cacheName, String& actualCacheName) at Sitecore.Commerce.Connect.CommerceServer.Caching.EnterpriseLibraryCacheProvider.GetData[T](String prefix, String cacheName, String cacheKey) at Sitecore.Foundation.Commerce.Website.Util.CartCacheHelper.GetCart(String customerId) in D:\Projects\External\DC Ecomm\sitecore.demo.retail\src\Foundation\Commerce\Website\Sitecore.Foundation.Commerce.Website\Util\CartCacheHelper.cs:line 65 at Sitecore.Feature.Commerce.Orders.Website.Controllers.CartController.GetCurrentCart() in D:\Projects\External\DC Ecomm\sitecore.demo.retail\src\Feature\Orders\Website\Sitecore.Feature.Commerce.Orders.Website\Controllers\CartController.cs:line 139

Nested Exception

Exception: Microsoft.Practices.Unity.ResolutionFailedException Message: Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager", name = "Sitecore_CommerceCartCache". Exception occurred while: while resolving. Exception is: InvalidOperationException - The current type, Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager, is an interface and cannot be constructed. Are you missing a type mapping?

1 Answer 1

3

probably it is too late to answer this, but as a reference for other which encountered the same problem. After installation i have got the same error, the reason for me was, i forgot to merge the merge configs to the web.config as mentioned here:

  1. Go to the Website folder and open the web.config file.
  2. Navigate to the \Website\MergeFiles folder.
    • Merge the contents of the Merge.CommerceServer.config file into the web.config file.
    • Merge the contents of Merge.Commerce.Storefront.config file into the web.config file.
  3. Save your changes to the web.config file.

Hope it helps others.

1
  • 1
    It's never too late to answer :-)
    – Mark Cassidy
    Commented May 17, 2019 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.