Base solution for your next web application
Open Closed

Cannot clear caches when using the AbpPerRequestRedisCache #10399


User avatar
0
rickfrankel created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version?
  • 10.3
  • What is your product type (Angular or MVC)?
  • Angular
  • What is product framework type (.net framework or .net core)?
  • .Net Core

If issue related with ABP Framework

  • What is ABP Framework version? 6.3.1 also running Abp.AspNetCore.PerRequestRedisCache - 1.0.0

When using the maintenance screens to clear all cache or any individual cache you get the below exception. Also looking at the code here https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.AspNetCore.PerRequestRedisCache/Runtime/Caching/Redis/AbpPerRequestRedisCache.cs

It doesn't appear as though the redis cache is cleared at all. It just looks to clear the HttpContext per reqeust cache.

Ideally it should be doing both I would think?

ERROR 2021-06-23 13:57:44,733 [33 ] Mvc.ExceptionHandling.AbpExceptionFilter - Unable to cast object of type 'System.Object' to type 'System.String'. System.InvalidCastException: Unable to cast object of type 'System.Object' to type 'System.String'. at Abp.Runtime.Caching.Redis.AbpPerRequestRedisCache.Clear() at Abp.Runtime.Caching.AbpCacheBase.ClearAsync() at Inbound.Caching.CachingAppService.ClearAllCaches() in C:\Source\Inbound\aspnet-core\src\Inbound.Application\Caching\CachingAppService.cs:line 44 at lambda_method6307(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.


1 Answer(s)