title: InvalidProgramException: Common Language Runtime detected an invalid program
body: <p>All,</p>
  
  <p>I'm running into trouble deploying an ASP.NET 4.0 web page. The error is</p>
  
  <p>System.InvalidProgramException: Common Language Runtime detected an invalid program</p>
  
  <p>The error occurs on IIS7 on a 64 bit Windows Server box. The same page works on IIS7 on my development box (32bit Windows 7) and in the Visual Studio Development Environment. I'm not aware of any differences in the IIS7 configuration.</p>
  
  <p>I've used PEVerify to validate the dll's in the application's bin directory. </p>
  
  <p>I can reproduce the problem by using an Entity Framework query to populate a DataGrid.DataSource. It is not a particularly heavy query.</p>
  
  <p>Any ideas on what could be causing this? My next step is to try and simply the queries used.</p>
  
  <p>Thanks for any help.</p>