Product version: 10.3.0 Product type: Angular Product framework type: .net core ABP Framework version: 6.3.0.0
I'm in the process of implementing import functionality, but the AsyncBackgroundJob's ExecuteAsync is not being called, a exception is happening inside Abp.BackgroundJobs.BackgroundJobManager but I can't step into that part of the code base. Here are the steps I take when I compe up against this issue:
I go to users and import an excel file
The thread executes ImportFromExcel(), the file is saved inside the database, everything appears to be going correctly
The constructor of the background job is called, so BackgroundJobManager is instantiating the job
ExecuteAsync is never called. ImportUsersToExcelJob is being instantiated repeatedly by BackgroundJobManager in the background but ExecuteAsync is never called.
If I look in the Logs.txt, I see the following exception when BackgroundJobManager attempts to run the job
SELECT TOP(@__p_1) [a].[Id], [a].[CreationTime], [a].[CreatorUserId], [a].[IsAbandoned], [a].[JobArgs], [a].[JobType], [a].[LastTryTime], [a].[NextTryTime], [a].[Priority], [a].[TryCount] FROM [AbpBackgroundJobs] AS [a] WHERE ([a].[IsAbandoned] <> CAST(1 AS bit)) AND ([a].[NextTryTime] <= @__Now_0) ORDER BY [a].[Priority] DESC, [a].[TryCount], [a].[NextTryTime] WARN 2021-11-23 09:59:47,962 [4 ] Abp.BackgroundJobs.BackgroundJobManager - Object does not match target type. System.Reflection.TargetException: Object does not match target type. at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target) at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Abp.BackgroundJobs.BackgroundJobManager.TryProcessJobAsync(BackgroundJobInfo jobInfo)
An exception is being thrown in BackgroundJobManager. Why is this exception being thrown? Is there a serialization/parsing error happening somewhere? I've tried changing ImportUsersFromExcelJobArgs
to a simpler object. I've tried adding [Serializable]
to it as well, but it doesn't seem to help.
If you've got any ideas, I'd appreciate it.