title: Could not load file or assembly 'EntityFramework' after downgrading from 4.5 to 4.0 with EF5
body: <p>I recently developed a .net 4.5 library using Entity Framework 5. Everything worked fine until I've been told I had to downgrade to .net 4.0 in order to remain compatible with Windows 2003.</p>
  
  <p>I uninstall EF 5 using the Package Manager Console and had the successfull message, then this one:</p>
  
  <pre><code>Failed to generate binding redirects for 'MyProjectName'. An item with the same key has already been added.
  </code></pre>
  
  <p>The same message appears after downgrading and installation of Entity Framework.</p>
  
  <p>Everything compile. But on execution I've this exception: </p>
  
  <pre><code>The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception.
  
  Could not load file or assembly 'EntityFramework, Version=5.0.0.0,Culture=neutral,     
  PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's   
  manifest definition does not match the assembly reference. (Exception from HRESULT:
  0x80131040)":"EntityFramework, Version=5.0.0.0, Culture=neutral,
  PublicKeyToken=b77a5c561934e089"
  </code></pre>
  
  <p>In the Web.Config (and App.Config of the libraries) I have those lines:</p>
  
  <pre><code>&lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/&gt;
  ...
  &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
          &lt;dependentAssembly&gt;
              &lt;assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089"
                        culture="neutral" /&gt;
              &lt;bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /&gt;
          &lt;/dependentAssembly&gt;
     &lt;/assemblyBinding&gt;
  &lt;/runtime&gt;
  </code></pre>
  
  <p>Any help would be appreciated.</p>