Base solution for your next web application
Open Closed

Getting error while running migrator project #12417


User avatar
0
kansoftware created

Hello Team,

I am using IAbpPerRequestRedisCacheManager in my project. When running the Migrator project, I encounter the following error because UserFriendsCache is utilizing IAbpPerRequestRedisCacheManager.

Additionally, UserFriendsCache is dependent on ChatUserStateWatcher, which in turn is used in the CDPCoreModule class.

Error : Castle.MicroKernel.Handlers.HandlerException: 'Can't create component 'CDP.Friendships.Cache.UserFriendsCache' as it has dependencies to be satisfied. 'CDP.Friendships.Cache.UserFriendsCache' is waiting for the following dependencies:

  • Service 'Abp.Runtime.Caching.Redis.IAbpPerRequestRedisCacheManager' which was not registered.'

Find below the screenshots for reference :

Please assist with resolving this issue.

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

1 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @kansoftware

    Did you define the setting mentioned under the heading in this document when calling the UseRedis method?

    [DependsOn(typeof(AbpAspNetCorePerRequestRedisCacheModule))]
    public class AbpZeroTemplateWebCoreModule : AbpModule
    {
        //...
         public override void PreInitialize()
         {
            //...
             Configuration.Caching.UseRedis(options =>
             {
                 options.ConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"];
                 options.DatabaseId = _appConfiguration.GetValue<int>("Abp:RedisCache:DatabaseId");
             }, usePerRequestRedisCache: true);
         }
    }
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)