title: Hangfire dynamically loading assemblies via. Reflection
body: <p>I'm currently having trouble integrating Hangfire into our solutions.
  We have currently a system consisting of three components.</p>
  
  <ul>
  <li>Modular MVC Application</li>
  <li>Windows Service as a BackgroundJob Server (Hangfire)</li>
  <li>MVC Application with Hangfire Dashboard</li>
  </ul>
  
  <p>The Windows Service is now loading the assemblies from the modular Application (due to release cycles).</p>
  
  <p>This is done via. <a href="https://msdn.microsoft.com/de-de/library/1009fa28%28v=vs.110%29.aspx?f=255&amp;MSPPError=-2147217396" rel="nofollow noreferrer">Assembly.LoadFrom()</a>.</p>
  
  <p>When we now Schedule a job via. the MVC Application, the job fails with the error:</p>
  
  <blockquote>
    <p>System.IO.FileNotFoundException</p>
    
    <p>Could not load file or assembly 'MyApp.Module.Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.</p>
  </blockquote>
  
  <p>I have already had a look at the following posts, but they do not mach what I need:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/35219144/hangfire-failes-to-load-assembly">Hangfire failes to load assembly</a></li>
  <li><a href="https://github.com/HangfireIO/Hangfire/issues/558" rel="nofollow noreferrer">https://github.com/HangfireIO/Hangfire/issues/558</a></li>
  <li><a href="https://stackoverflow.com/questions/39991196/hangfire-filenotfoundexception-could-not-load-file-or-assembly-dynamicproxygena?rq=1">Hangfire FileNotFoundException: Could not load file or assembly DynamicProxyGenAssembly,</a></li>
  <li>and others</li>
  </ul>
  
  <p>Other infos:</p>
  
  <ol>
  <li>I can not reference the shared assemblies directly, it must be loaded at runtime</li>
  <li>I can not use a common interface project, that has to be referenced</li>
  <li>I can't customise hangfire like this <a href="https://github.com/gandarez/Hangfire" rel="nofollow noreferrer">Hangfire branche</a></li>
  </ol>
  
  <p>Has anyone an idea, how to implement this without adding references</p>
  
  <p>Thanks for your help.</p>
  
  <p>Regards</p>
  
  <p>Michael</p>