EasyCaching icon indicating copy to clipboard operation
EasyCaching copied to clipboard

1.6version Wroked with MediatR framework throw nullreferenceException

Open charzhao opened this issue 1 year ago • 1 comments

if you use MediatR and EasyCaching and also use two level cache .

you will get nullreferenceException at MediatR handler layer.

at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) DependencyResolutionException An exception was thrown while activating GigaLife.Questionnaire.Application.Queries.QuestionnaireTemplate.QuestionnaireTemplateQueryHandler -> GigaLife.Questionnaire.Repository.QuestionnaireTemplateRepository -> EasyCaching.Interceptor.Castle.EasyCachingInterceptor -> λ:EasyCaching.Core.IHybridCachingProvider -> EasyCaching.Bus.CSRedis.DefaultCSRedisBus -> λ:EasyCaching.Bus.CSRedis.EasyCachingCSRedisClient[] -> λ:EasyCaching.Bus.CSRedis.EasyCachingCSRedisClient. Void Execute(Autofac.Core.Resolving.Pipeline.ResolveRequestContext, System.Action1[Autofac.Core.Resolving.Pipeline.ResolveRequestContext]) at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) at Tesla.Enterprise.Core.ServiceCollectionExtension.<>c__DisplayClass0_0.<ConfigureCoreServices>b__1(Type t) at MediatR.ServiceFactoryExtensions.GetInstance[T](ServiceFactory factory) at MediatR.Internal.RequestHandlerBase.GetHandler[THandler](ServiceFactory factory) NullReferenceException Object reference not set to an instance of an object. EasyCaching.Bus.CSRedis.EasyCachingCSRedisClient <AddServices>b__3_0(System.IServiceProvider) at EasyCaching.Bus.CSRedis.CSRedisOptionsExtension.<>c.<AddServices>b__3_0(IServiceProvider x)

charzhao avatar Aug 10 '22 05:08 charzhao

@charzhao Thanks for your interest in this project.

Could you please provide a sample to reproduce this issue?

catcherwong avatar Aug 10 '22 14:08 catcherwong

No response, Closed!

catcherwong avatar Jan 01 '23 03:01 catcherwong