Hangfire error: could not load file or assembly ‘dynamicproxygenassembly2, culture = neutral, publickeytoken = null’. The system could not find the specified file.

The question is as follows:

Method of recurringrob:

//The reason for the error: As you can see from the first way in the red box above, you can not specify the class to which the methodCall belongs, but the limitation of this case is that the methodCall method executed by the job belongs to the same class as the job. In this case, it does belong to the same class, but the error is still reported.
RecurringJob.AddOrUpdate(recurringJobId, () => PushJobContent(), cronData, TimeZoneInfo.Local);

It is also the full version of the old honest and practical version, indicating the class to which the execution method belongs. After modification:

RecurringJob.AddOrUpdate<MessagePushAppService>(recurringJobId, x => x.PushJobContent(), cronData, TimeZoneInfo.Local);

Normal operation.

Notes:

1. Hangfire local time: timezoneinfo.local

2. UTC time: timezoneinfo.utc

Associated reading > Hangfire scheduled task method is not defined

Similar Posts: