title: Could not load file or assembly Autofac
body: <p>I have a CLI program that runs different tasks on the database every night. When trying to run the program manually I get the following error message. The code hasn't even hit Program.cs as that would output some messages to the console.</p>
  
  <blockquote>
    <p>Could not load file or assembly 'Autofac, Version=4.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)</p>
  </blockquote>
  
  <p>However, when debugging through visual studio on a local database the problem does not occur, only on our test and prod servers. There is no mismatch between Autofac versions (4.8.1) or missing references in the CLI project.</p>
  
  <p>I have looked at <a href="https://stackoverflow.com/questions/19133599/could-not-load-file-or-assembly-autofac-version-3-0-0-0">Could not load file or assembly &#39;Autofac, Version=3.0.0.0</a> but that was not the solution. I have tried cleaning and rebuilding, without success.</p>
  
  <p>We haven't had this problem earlier; it occured after our latest release. However, we haven't made any significant changes to how Autofac works, version update, or the like.</p>