Why can't Hangfire find the executable it is running from?

36 Views Asked by At

I have a very strange problem. I have a self-contained .NET 7 app. The executable is named MyCompany.GVA.Api.exe . After running it, I executed the following SQL Code.

select * from HangFire.State s inner join HangFire.Job J on J.Id = s.JobId
where Reason like '%Could not resolve%' order by s.CreatedAt asc

This is the output:

Id JobId Name Reason CreatedAt Data Id StateId StateName InvocationData Arguments CreatedAt ExpireAt
3 1 Scheduled Retry attempt 1 of 10: Could not resolve assembly 'MyCompany.GVA.Api'. 2024-03-19 11:48:11.953 {"EnqueueAt":"1710848915953","ScheduledAt":"1710848891953"} 1 7 Scheduled {"t":"MyCompany.GVA.Api.BatchJobs.ComplianceRequirementsBatchJob, MyCompany.GVA.Api","m":"InitializeGVABatchJobAsync","p":["MyCompany.GVA.Args.BatchJob.ComplianceRequirementsBatchJobArgs, MyCompany.GVA.Args"]} ["{}"] 2024-03-19 11:48:11.853 null
5 1 Scheduled Retry attempt 2 of 10: Could not resolve assembly 'MyCompany.GVA.Api'. 2024-03-19 11:48:35.353 {"EnqueueAt":"1710848947353","ScheduledAt":"1710848915353"} 1 7 Scheduled {"t":"MyCompany.GVA.Api.BatchJobs.ComplianceRequirementsBatchJob, MyCompany.GVA.Api","m":"InitializeGVABatchJobAsync","p":["MyCompany.GVA.Args.BatchJob.ComplianceRequirementsBatchJobArgs, MyCompany.GVA.Args"]} ["{}"] 2024-03-19 11:48:11.853 null

In addition, MyCompany.GVA.Api.exe and MyCompany.GVA.Api.dll are both in the same folder. Therefore, the error looks like complete nonsense to me, even like a lie. But it still needs to be resolved someway.

It shows that my my Hangfire application cannot find itself. Why? How can an application possibly have issues finding itself? And how should I resolve this issue?

0

There are 0 best solutions below