title: Could not load file or assembly ... or one of its dependencies. An attempt was made to load a program with an incorrect format (.resx file)
body: <p>I am getting the following error message when compiling or attempting to run my application on Windows 7 64 bit. I've scoured the Internet and many people have the same error message. However, none of the solutions address my problem or situation. I am using <a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_2010" rel="noreferrer">Visual Studio 2010</a>.</p>
  <h3>Error message</h3>
  <blockquote>
  <p>Error 38 Could not load file or assembly 'file:///D:/Projects/Windows Projects/Weld/Components/FileAttachments/FileAttachments/FileAttachments/bin/x86/Debug/FileAttaching.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. Line 1212, position 5. D:\Projects\Windows Projects\Weld\Weld\Weld.UI\frmMain.resx 1212 5 Weld.UI</p>
  </blockquote>
  <h3>Description</h3>
  <p>OK, so I have two projects, a UI project and a FileAttachment project. The UI project has a reference to the FileAttachment project. When I compile the UI project in &quot;Any CPU&quot; mode, everything works fine, and it runs. I assume 'Any CPU' will run in 64-bit mode when I compile as that is the platform I am using.</p>
  <p>I want to run/compile as x86, so I try to do that. I change the configuration for all projects to x86 and verify that these configurations are compiling to x86. I compile and get the error as stated above.</p>
  <p>I find it odd that it compiles and works fine in 64-bit but not 32-bit. However, when compiled and deployed to users as 'Any CPU', if these users have x86 it still works for them without any problems. I just can't compile or run as x86 on my PC. Again, I can compile as <em>Any CPU</em> and deploy to a 32-bit PC without any problems.</p>
  <p>Neither projects are referencing any 64-bit-only DLL files. Both projects are verified to be targeting 32-bit DLL files and .NET Framework assemblies.</p>
  <p>I need to compile and run this locally under 32-bit mode. I need JIT edit/continue, among other things.</p>
  <p>Here is the line of code in the resx file that is causing the problem:</p>
  <pre><code> &lt;data name=&quot;ImageList1.ImageStream&quot; mimetype=&quot;application/x-microsoft.net.object.binary.base64&quot;&gt;
  ....{mime data}....
   &lt;/data&gt;
  </code></pre>
  <p>The resx file is verified to be generated for .NET 2.0 and is only referencing .NET 2.0 assemblies and not .NET 4.0 versions.</p>
  <p>How can I fix this problem? I've searched the Internet and have found hundreds of people with the same error message, but a different problem.</p>