Hangfire Could not load file or assembly 'DynamicProxyGenAssembly2

i have setup hangfire as below in my startup

var t = IocManager.Resolve();

        RecurringJob.AddOrUpdate("sendDailyEmail",() => t.sendEmail(), Cron.Daily);

when i access the hangfire dashboard , i can see the Recurring Jobs 1 , but the job is not executed and i get the error

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.

what is wrong with my setup?

Hi, i have the problem also ,had you solve this?

FYI I had this same problem today, and resolved it with syntax similar to the following:

RecurringJob.AddOrUpdate<IEmailInterface>("sendDailyEmail", t => t.sendEmail(), Cron.Daily);

2 Likes