"Could not load the job" when scheduling the job from dynamically loaded module


#1

Our application has modular architecture and some modules are loaded from location other than app’s root (they are located in subfolder Modules/PaymentsImport.dll). We’re using MEF to load these modules.
When I’m trying to schedule job from any dynamically loaded module, I’m getting error:
Recurring job 'PaymentsImportJob.Execute' can not be scheduled due to job load exception. Hangfire.Common.JobLoadException: Could not load the job. See inner exception for the details. ---> System.IO.FileNotFoundException: Не удалось загрузить файл или сборку "PaymentsImport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" либо одну из их зависимостей. Не удается найти указанный файл.

Why are you trying to load assembly, when it is already loaded in app domain?

P.S. I’m trying to schedule via generic method:
RecurringJob.AddOrUpdate<PaymentsImportJob>(j => j.Execute(), Cron.Daily);