title: Mixed mode assembly is built against version '2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime
body: <p>I'm using Visual Studio 2012 and the .Net Framework 4.5
  I have 2 Solutions: 1) WPF Application 2) Class library (dll)</p>
  
  <p>The Class Library contains 3 buttons and a control that has to be inside a WindosFormsHost control since it was made for WinForms. </p>
  
  <p>The only referenced assemblies outside of the .NET Framework ones are for the aforementioned winforms control and iTextSharp.</p>
  
  <p>The winforms control seems to be kinda old and when I put the reference in my dll I got the same error as the title but following other SO questions/answers, my I put this in my config file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
      &lt;startup useLegacyV2RuntimeActivationPolicy="true"&gt; 
          &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /&gt;
      &lt;/startup&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The error:</p>
  
  <p><strong>Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information</strong></p>
  
  <p>As I mentioned, I've seen questions posting this issue, and they did solve the issue in my DLL project, but in the project using that DLL I've tried them all to no avail. For reference:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/2455654/what-additional-configuration-is-necessary-to-reference-a-net-2-0-mixed-mode">What &#39;additional configuration&#39; is necessary to reference a .NET 2.0 mixed mode assembly in a .NET 4.0 project?</a></li>
  <li><a href="https://stackoverflow.com/questions/6425707/mixed-mode-assembly-is-built-against-version-v2-0-50727-of-the-runtime">Mixed mode assembly is built against version ‘v2.0.50727′ of the runtime</a></li>
  <li><a href="https://stackoverflow.com/questions/1604663/what-does-uselegacyv2runtimeactivationpolicy-do-in-the-net-4-config">What does &#39;useLegacyV2RuntimeActivationPolicy&#39; do in the .NET 4 config?</a></li>
  <li><a href="https://stackoverflow.com/questions/11966213/mixed-mode-assembly-is-built-against-version-v2-0-50727-of-the-runtime-and-can">Mixed mode assembly is built against version &#39;v2.0.50727&#39; of the runtime and cannot be loaded in the 4.0 runtime</a></li>
  <li><a href="https://stackoverflow.com/questions/9772265/mixed-mode-assembly-is-built-against-version-x-and-cannot-be-loaded-in-version-y">Mixed mode assembly is built against version X and cannot be loaded in version Y of the runtime without additional configuration information</a></li>
  </ol>
  
  <p>In that project my config file has the exact same tags with the same values.</p>
  
  <p>Also to note, in my WPF Application, at the beginning I was getting an error about it not being able to find the specified dll (for the winforms control), in the end I put that control's dll in the GAC.</p>
  
  <p>I've tried changing my target framework for all of the possibilities (4.5, 4.0 full and client, 3.5 full and client, 3.0 and 2.0), building my DLL in debug and release and setting the "Generate serialization assembly" to OFF, also, changed the platform target from Any CPU to x86 and x64. I only tried changing the value of one setting at a time.</p>
  
  <p>Is this a problem in VS2012 or what do I need to do to solve this?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The above error is shown at design time in the errors list, the designer shows an error saying "Cannot create an instance of 'my_class'"</p>
  
  <p>The inner exception of that one says: "Set connectionId threw an exception" and the inner exception of this is the title message.</p>
  
  <p>This still allows the solution to be built, and upon running the application, I get basically the same, except that the innermost exception says:</p>
  
  <p><strong>"Could not load file or assembly 'SigPlusNET, Version=1.1.3358.14336, Culture=neutral, PublicKeyToken=6aef07010bb0624f' or one of its dependencies. An attempt was made to load a program with an incorrect format."</strong></p>
  
  <p>That one is the winForms control's assembly, upon inspection through dotPeek, the only dependencies it has are .NET Framework ones</p>