abp icon indicating copy to clipboard operation
abp copied to clipboard

Volo.Abp.BackgroundJobs.BackgroundJobStore facing issue for this entire error stack is given below

Open nayanranjane opened this issue 2 years ago • 8 comments

An exception was thrown while activating Volo.Abp.BackgroundJobs.BackgroundJobStore -> Volo.Abp.ObjectMapping.DefaultObjectMapper1[[Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainModule, Volo.Abp.BackgroundJobs.Domain, Version=4.2.1.0, Culture=neutral, PublicKeyToken=null]] -> Volo.Abp.AutoMapper.AutoMapperAutoObjectMappingProvider1[[Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainModule, Volo.Abp.BackgroundJobs.Domain, Version=4.2.1.0, Culture=neutral, PublicKeyToken=null]] -> ?:Volo.Abp.AutoMapper.IMapperAccessor -> ?:Volo.Abp.AutoMapper.MapperAccessor. Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Abp.BackgroundJobs.BackgroundJobStore -> Volo.Abp.ObjectMapping.DefaultObjectMapper1[[Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainModule, Volo.Abp.BackgroundJobs.Domain, Version=4.2.1.0, Culture=neutral, PublicKeyToken=null]] -> Volo.Abp.AutoMapper.AutoMapperAutoObjectMappingProvider1[[Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainModule, Volo.Abp.BackgroundJobs.Domain, Version=4.2.1.0, Culture=neutral, PublicKeyToken=null]] -> ?:Volo.Abp.AutoMapper.IMapperAccessor -> ?:Volo.Abp.AutoMapper.MapperAccessor. ---> System.ArgumentException: GenericArguments[0], 'System.Guid', on 'T MaxIntegerT' violates the constraint of type 'T'. ---> System.Security.VerificationException: Method System.Linq.Enumerable.MaxInteger: type argument 'System.Guid' violates the constraint of type parameter 'T'. at System.RuntimeMethodHandle.GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[] methodInstantiation) at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation) --- End of inner exception stack trace --- at System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e) at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation) at AutoMapper.TypeDetails.<>c__DisplayClass28_1.<BuildPublicNoArgExtensionMethods>b__10(MethodInfo extensionMethod) at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Enumerable.ConcatIterator1.MoveNext() at System.Linq.Enumerable.SelectManyIterator[TSource,TCollection,TResult](IEnumerable1 source, Func2 collectionSelector, Func3 resultSelector)+MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Collections.Generic.HashSet1.UnionWith(IEnumerable1 other) at System.Linq.Enumerable.UnionIterator1.FillSet() at System.Linq.Enumerable.UnionIterator1.ToArray() at AutoMapper.TypeDetails.BuildPublicNoArgExtensionMethods(IEnumerable1 sourceExtensionMethodSearch) at AutoMapper.TypeDetails..ctor(Type type, ProfileMap config) at AutoMapper.ProfileMap.TypeDetailsFactory(Type type) at AutoMapper.Internal.LockingConcurrentDictionary2.<>c__DisplayClass2_1.<.ctor>b__1() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at AutoMapper.Internal.LockingConcurrentDictionary2.GetOrAdd(TKey key) at AutoMapper.ProfileMap.CreateTypeDetails(Type type) at AutoMapper.TypeMapFactory.CreateTypeMap(Type sourceType, Type destinationType, ProfileMap options, Boolean isReverseMap) at AutoMapper.ProfileMap.BuildTypeMap(IConfigurationProvider configurationProvider, ITypeMapConfiguration config) at AutoMapper.ProfileMap.Register(IConfigurationProvider configurationProvider) at AutoMapper.MapperConfiguration.Seal() at AutoMapper.MapperConfiguration..ctor(MapperConfigurationExpression configurationExpression) at AutoMapper.MapperConfiguration..ctor(Action1 configure) at Volo.Abp.AutoMapper.AbpAutoMapperModule.CreateMappings(IServiceProvider serviceProvider) at Autofac.Extensions.DependencyInjection.AutofacRegistration.<>c__DisplayClass3_0.<Register>b__0(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Activators.Delegate.DelegateActivator.<ConfigurePipeline>b__2_0(ResolveRequestContext ctxt, Action1 next) at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) --- End of inner exception stack trace --- 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.Core.Resolving.ResolveOperation.Execute(ResolveRequest request) at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(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, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Volo.Abp.BackgroundJobs.BackgroundJobWorker.DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) at Volo.Abp.BackgroundWorkers.AsyncPeriodicBackgroundWorkerBase.DoWorkAsync()

nayanranjane avatar Dec 27 '23 06:12 nayanranjane

hi

  • Steps needed to reproduce the problem.

maliming avatar Dec 27 '23 06:12 maliming

using one abp commertial here are sample steps to reproduce the issue services.AddApplication<THttpApiHostModule>(); services.AddDbContext<TDbContext>(); services.ConfigureMultiTenancy(); services.ConfigureHttpClientProxies<TApplicationContractsModule>(); services.ConfigureAutoMapper<TApplicationModule>(); services.ConfigureDI();

nayanranjane avatar Dec 27 '23 08:12 nayanranjane

I have legacy code which is using all the abp commertial version of 4.2 and I have created this as a shared project now I am using this shared project in .net 5 project which is working fine but when I try to use the same shared code in .net core 7 Project I am getting above error for backgroundJobs please advice

nayanranjane avatar Dec 27 '23 12:12 nayanranjane

I can't reproduce the problem based on the information you provided.

maliming avatar Dec 28 '23 03:12 maliming

Just want to know can we use entire abp.comertial version project which is in 4.2 can we use this all volo libraries in .net core 7

nayanranjane avatar Dec 28 '23 05:12 nayanranjane

hi

All abp 4.2 packages target is net5.0. I think you can't use it in net 7.

maliming avatar Dec 29 '23 05:12 maliming