Hi, I tried to add Hangfire recurring jobs in ASP.NET Zero, but could not get it working. Below is what I did:
Create a BackgroundJobAppService insideAPP.Application project, where background tasks will be performed.
Add the following code inside the PostInitialize method of APPWebModule class inAPP. Web project:
var backgroundAppService = IocManager.IocContainer.Resolve<IBackgroundAppService>(); RecurringJob.AddOrUpdate("SoftwareAlert", () => backgroundAppService.SendSoftwareExpiryAlerts(), Cron.Minutely);
However, when I checked the Hangfire dashboard, it showed the following error message:
Could not load file or assembly 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Can anyone help? Much appreciated.
Thanks
1 Answer(s)
-
0
Hi,
Can you try to use DomainService instead of AppService for your background job and manage unitOfWork inside your domain service. There is a similar issue by the way, you can read it as well. #2645
Thanks.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)