title: ASP.NET 4, Entity Framework 4.2, IIS 7: Erratic behavior only fixed by restarting IIS?
body: <p>Using IIS 7, ASP.NET MVC 3, and EF 4.2, I load content from a database then send it to the client (nothing strange yet):</p>
  
  <pre><code> var result = DB.Contacts.Select( p =&gt; new { id=p.ID, name=p.name }).ToList();
   return Json(result);
  </code></pre>
  
  <p>We tested it, approved it, and have it running at customers.  This is what it normally sends back:</p>
  
  <pre><code>"[{"id":1,"name":"one"},{"id":2,"name":"two"}]"
  </code></pre>
  
  <p>This is what it sends back when it's malfunctioning, which doesn't stop until we restart the IIS service (WWW):</p>
  
  <pre><code>"[{"id":null,"name":null},{"id":null,"name":null}]"
  </code></pre>
  
  <p>We haven't been able to recreate the issue on purpose, but once we were debugging in VS 2010 on Windows 7 and the debugger would step through code at random, jumping in a function from the 4th line to the first line, out of the function, back in the function, etc.</p>
  
  <p><strong>What would cause this and how do you avoid it?</strong>  We experience this on several different servers and workstations at several different customer locations.  For the most part, SQL Server 2008 or 2005 runs on the same machine as IIS 7.</p>