title: .NET reflection on system assemblies fails on System.Data.dll
body: <p>I have a language compiler that I've just updated to target .NET 4.0 and the metadata generator for framework assemblies now fails on System.Data.dll, while all others work fine (mscorlib, System, etc.)</p>
  
  <p>The metadata generator simply loads assemblies, reflects over all the types and memberinfo and generates a stub class for the language.</p>
  
  <p>I'm using Assembly.Load() and/or <code>Assembly.ReflectionOnlyLoad()</code></p>
  
  <blockquote>
    <p><em>Could not load file or assembly 'file:///c:\windows\Microsoft.NET\framework\v4.0.30319\System.Data.dll'
    or one of its dependencies. An attempt was made to load a program with
    an incorrect format.</em></p>
  </blockquote>
  
  <p>It is built for "AnyCPU". I'm running Windows 7/x64 with .NET 4.5 update installed.</p>