Base solution for your next web application
Open Closed

AbpMemoryCacheManager Error #5063


User avatar
0
PhilWynn created

Hi,

I have recently upgraded from ABP v2.1 to the current version. I am finding that my error log is filled with the following error message. Please could you advise.

ERROR 2018-05-03 11:47:28,105 [15 ] ime.Caching.Memory.AbpMemoryCacheManager - System.ArgumentOutOfRangeException: The relative expiration value must be positive. Parameter name: AbsoluteExpirationRelativeToNow Actual value was 00:00:00. at Microsoft.Extensions.Caching.Memory.CacheEntry.set_AbsoluteExpirationRelativeToNow(Nullable1 value) at Microsoft.Extensions.Caching.Memory.CacheExtensions.Set[TItem](IMemoryCache cache, Object key, TItem value, TimeSpan absoluteExpirationRelativeToNow) at Abp.Runtime.Caching.Memory.AbpMemoryCache.Set(String key, Object value, Nullable1 slidingExpireTime, Nullable1 absoluteExpireTime) at Abp.Runtime.Caching.CacheBase.Get(String key, Func2 factory) System.ArgumentOutOfRangeException: The relative expiration value must be positive. Parameter name: AbsoluteExpirationRelativeToNow Actual value was 00:00:00. at Microsoft.Extensions.Caching.Memory.CacheEntry.set_AbsoluteExpirationRelativeToNow(Nullable1 value) at Microsoft.Extensions.Caching.Memory.CacheExtensions.Set[TItem](IMemoryCache cache, Object key, TItem value, TimeSpan absoluteExpirationRelativeToNow) at Abp.Runtime.Caching.Memory.AbpMemoryCache.Set(String key, Object value, Nullable1 slidingExpireTime, Nullable1 absoluteExpireTime) at Abp.Runtime.Caching.CacheBase.Get(String key, Func2 factory)

Many thanks


10 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team
  • User Avatar
    0
    PhilWynn created

    Hi,

    Yes, migration to ABP 3.5.

    I was previously running ABP 2.1, on Asp Net Zero 4.0

    Is this not possible? Is there a guide for me to upgrade ABP from where I am?

    Regards

  • User Avatar
    0
    PhilWynn created

    Note that I am not looking to upgrade Asp Net Zero here. Just the ABP libraries.

  • User Avatar
    0
    alper created
    Support Team

    try to inject ICachingConfiguration

    private readonly ICachingConfiguration _cacheConfig;
    //...
     _cacheConfig.DefaultSlidingExpireTime = TimeSpan.FromHours(24);
    
  • User Avatar
    0
    ismcagdas created
    Support Team

    @ PhilWynn yes it is possible. Have you also upgraded ASP.NET packages to the version ABP v3.5 reqires ?

  • User Avatar
    0
    PhilWynn created

    Hi,

    Yes, I have ensured that all other dependencies have been updated.

    Apart from a few tweaks, all seems to be working well apart from the error message shown in my initial message. I do not know what is generating this error, but it appears on each page load. I am unsure of how to provide the full stack trace, as I am only noticing this error from the logs.

    Apologies, but I am not sure how inject ICachingConfiguration will help me here. Could you give more info please.

    Many thanks.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @PhilWynn do you have any cache class which doesn't come with the default template ? If so, can you share it's code ?

    If not, please share your log file if there is no condidential information in it.

  • User Avatar
    0
    PhilWynn created

    Hi,

    I don't have any custom cache classes in use, only those provided by AspNetZero 4.0 (see screen shot attached).

    [attachment=0:86rm7kyr]caching.png[/attachment:86rm7kyr]

    I have attached the log file.

    Regards. WebSiteLogs.zip

  • User Avatar
    0
    ismcagdas created
    Support Team

    @PhilWynn is it possible for you to share your project via email ? If you can, please send it to <a href="mailto:[email protected]">[email protected]</a> and we will check it.

  • User Avatar
    0
    PhilWynn created

    On it's way...

    Thank you