Hangfire failes to load assembly
<p><strong>Context</strong></p>

<p>I have two application in place, one is my main enterprise application and in other I have hangfire (hangfire server, client and dashboard) hosted. My main application also use hangfire for some long task and executes them asynchronously. Both using the same DB for HF storage. And there is only one HF server.</p>

<p><strong>Issue</strong></p>

<p>I am getting the following errors intermittently -</p>

<blockquote>
  <p>"Can not change the state to 'Processing': target method was not found."
  OR</p>
  
  <p>"Can not change the state to 'Enqueued': target method was not found."</p>
</blockquote>

<p>with following details -</p>

<blockquote>
  <p>System.IO.FileNotFoundException</p>
  
  <p>Could not load file or assembly 'MyApp.Hangfire, Version=1.0.0.0,
  Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
  system cannot find the file specified.</p>
</blockquote>

<p>where <strong>MyApp.Hangfire</strong> is my hangfire application executing jobs. And I am sure that it is there, and even some successful jobs affirms it.</p>

<p><em>Please find the attached screenshot for more details.</em></p>

<p><a href="https://i.stack.imgur.com/GksBR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GksBR.png" alt="enter image description here"></a></p>

<p><strong>Observation</strong></p>

<p>The issue is not consistent, the job not always fails, sometimes it fails, re queued and get passed and sometimes when it is out of retries it even fails. <em>As shown in screenshot</em></p>