title: Could not load file or assembly ... An attempt was made to load a program with an incorrect format (System.BadImageFormatException)
body: <p>I have two projects, <code>ProjectA</code> and <code>ProjectB</code>.  <code>ProjectB</code> is a console application, which depends on <code>ProjectA</code>.  Yesterday, everything was working fine, but suddenly today when I run <code>ProjectB</code> I get this:</p>
  
  <blockquote>
    <p><strong>BadImageFormatException was unhandled</strong>:<br>
    Could not load file or assembly 'ProjectA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.</p>
  </blockquote>
  
  <p>Both are just regular projects, with no dependencies on any other non-.Net projects.  Both are fully .Net - there is no native code, and no P/Invoke.  I have other projects which depend on <code>ProjectA</code> and still work just fine.</p>
  
  <p>Things I have tried:</p>
  
  <ul>
  <li>Make sure both projects are set to "Any CPU," with the <em>build</em> checkbox checked.  They are.</li>
  <li>Make sure both projects are for the same Target Framework <em>(.Net 4.0 Client Profile)</em>.</li>
  <li>Under ProjectB --> References --> ProjectA --> Properties, make sure <em>"Copy Local"</em> is set to <em>"True"</em> _ <em>(I verified that ProjectA.dll is being copied correctly)</em></li>
  <li>Clean/Rebuild the solution.  I even tried manually deleting the /bin and /obj folders in both projects.</li>
  <li>Restart Visual Studio.  Restart my computer.</li>
  <li>Check out an entirely new copy of the repository.</li>
  </ul>
  
  <p>But I still get the same error.  I have no idea what I did to cause this, nor how to fix it.  Any ideas?</p>