I configured a windows service using .net 6.0 to run hangfire. But when running the service the dashboards in the recurring jobs display “Could not resolve assembly ‘Name’” and in the succeeded Jobs once the job completes “Can not find the target method.”. While debugging the code I can see that my execution is being hit, but when I publish the project and run it the job does not process the data.
I actually have a windows service which runs a hangfire job to run 3 recurring jobs, but when it’s build is deployed on production server and ran, the hangfire dashboard displays following error for all 3 recurring jobs:
System.InvalidOperationException: Recurring job can't be scheduled, see inner exception for details.
---> Hangfire.Common.JobLoadException: Could not load the job. See inner exception for the details.
---> System.IO.FileNotFoundException: Could not resolve assembly 'ProjExchange.HangfireProj.MyJobName'.
Weird thing is if I try to manually trigger any of the jobs then that particular job runs successfully, only when it is made to run on its own, it throws this error.
I also checked the bin folder for the dll file of MyJobName
and it’s present there.
What can be the possible issue here?