title: use .Net 2.0 dll in .net 4.0 wpf application
body: <p>I am trying to add a reference to a .Net 2.0 DLL in a WPF application that is targeted to the .Net 4 Framework.</p>
  
  <p>I added <code>&lt;startup useLegacyV2RuntimeActivationPolicy="true"&gt;</code> to the app.config file. The WPF app builds fine, but gets a BadImageFormatException at Runtime when trying to access the .Net 2.0 DLL.</p>
  
  <p>"An attempt was made to load a program with an incorrect format"</p>
  
  <p>This works with a new test WPF project, but does not work on my app. My app uses Entity Framework and MEF. Could these technologies be causing the issue?</p>
  
  <p>Any ideas?</p>
  
  <p><strong>Edit: Resolved</strong></p>
  
  <p>According to the comment by Alois below, I had my main app targeted to 'Any CPU' and the DLL was targeted to 32-bit.</p>
  
  <p><code>&lt;startup useLegacyV2RuntimeActivationPolicy="true"&gt;</code> was not required</p>