title: How to reference an assembly which is built against version 'v2.0.xxx' of the runtime in IronPython 2.7?
body: <p>I am trying to create wrapper for an assembly (thirdPartyDLL) which was built against version 'v2.0.50727' of the runtime. But whenever I try to reference it in IronPython code, it always results in following error </p>
  
  <blockquote>
    <p><strong>IOError: System.IO.FileLoadException: 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>
  </blockquote>
  
  <p>My wrapper is a Class Library only, so there is no app.config or app.exe.config.</p>
  
  <ol>
  <li>I have tried changing my library's Target Framework to .NET Framework 2.0, but it didn't work. Gave me same error.</li>
  <li>Even tried <a href="http://reedcopsey.com/2011/09/15/setting-uselegacyv2runtimeactivationpolicy-at-runtime/" rel="nofollow noreferrer">http://reedcopsey.com/2011/09/15/setting-uselegacyv2runtimeactivationpolicy-at-runtime/</a> , but it didn't work in python and gave me following exception 
  
  <blockquote>
    <p><strong>A runtime has already been bound for legacy activation policy use.</strong></p>
  </blockquote></li>
  </ol>
  
  <p>Python code is pretty straight forward</p>
  
  <pre class="lang-py prettyprint-override"><code>import clr
  import sys
  sys.path.append(r"directoryPath")
  clr.AddReference(r"Test.dll")
  from Test import *
  testObj = testClass()
  raw_input("Press enter key to continue..")
  </code></pre>
  
  <p>Wrapper class library has following</p>
  
  <pre class="lang-cs prettyprint-override"><code>namespace Test
  {
      public class testClass()
      {
          public testClass()
          {
              thirdPartyDLLClass tClass = new thirdPartyDLLClass();
          }
      }
  }
  </code></pre>
  
  <p>I just want to compile and run the IronPython program without exceptions. I anyone can suggest anything new that I haven't tried then it would be so helpful. I am very new to python but I am good enough in C#.</p>
  
  <p>Thanks in advance.</p>