title: What appears to be a .net bug is happening after every recycle of a worker process. Only occurring when I'm using entity-framework
body: <p>I've written a vb.net project (.net 4) that seems to work perfectly on my windows 7 machine, and seems to work fine when published to a windows server 2003 server.</p>
  
  <p>The issue comes after a few hours on my server, I get the infamous "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information". I haven't seen this problem at all when using visual studio.</p>
  
  <p>Which seems to suggest to me that a reference to a dll / something is lost due to a cache process. Uploading <strong>anything</strong> to that folder temporally fixes the issue (including a test.txt file). Then after a few hours the issue returns.</p>
  
  <p>I've turned off search indexing on the server and insured that the server is up to date.. but the error keeps on returning. (on investigation it returns every time the worker process recycles)</p>
  
  <p>The issue only seems to appear on certain ascx files, these files reference an EntityDataSource that references an orders table.</p>
  
  <p>Also I have attempted to get the LoaderExceptions and any other data with the following code:</p>
  
  <pre><code>Try
      OrdersTable.DataBind()
  Catch ex As ReflectionTypeLoadException
      Response.Write(ex.Message)
  
      If (Not ex.InnerException Is Nothing) Then
          Response.Write(ex.InnerException.Message)
  
          Response.Write(ex.LoaderExceptions)
          For Each Parameter As DictionaryEntry In ex.Data
              Dim key As Object = Parameter.Key
              Dim value As Object = Parameter.Value
              Response.Write(key &amp; ":" &amp; value &amp; "&lt;br&gt;\n")
          Next
  
      End If
      Response.End()
  End Try
  </code></pre>
  
  <p>All that is written is the same error as before "Unable to load one or more of..."</p>
  
  <p>New to the .net framework so any suggestions will be very much appreciated :).</p>
  
  <p>Edit:
  Stack trace attached.</p>
  
  <pre><code>[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
  System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) +0
  System.Reflection.RuntimeModule.GetTypes() +4
  System.Reflection.Assembly.GetTypes() +78
  System.Data.Metadata.Edm.ObjectItemConventionAssemblyLoader.LoadTypesFromAssembly() +32
  System.Data.Metadata.Edm.ObjectItemAssemblyLoader.Load() +25
  System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, ObjectItemLoadingSessionData loadingData) +160
  System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, KnownAssembliesSet knownAssemblies, EdmItemCollection edmItemCollection, Action1 logLoadMessage, Object&amp; loaderCookie, Dictionary2&amp; typesInLoading, List1&amp; errors) +166
  System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies, EdmItemCollection edmItemCollection, Action1 logLoadMessage) +316
  System.Data.Metadata.Edm.ObjectItemCollection.ExplicitLoadFromAssembly(Assembly assembly, EdmItemCollection edmItemCollection, Action1 logLoadMessage) +53
  System.Data.Metadata.Edm.MetadataWorkspace.ExplicitLoadFromAssembly(Assembly assembly, ObjectItemCollection collection, Action1 logLoadMessage) +93
  System.Data.Metadata.Edm.MetadataWorkspace.LoadFromAssembly(Assembly assembly, Action1 logLoadMessage) +130
  System.Web.UI.WebControls.EntityDataSourceView.ConstructContext() +585
  System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +76
  System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
  System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
  System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
  System.Web.UI.WebControls.GridView.DataBind() +4
  System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
  System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +75
  System.Web.UI.Control.EnsureChildControls() +102
  System.Web.UI.Control.PreRenderRecursiveInternal() +42
  System.Web.UI.Control.PreRenderRecursiveInternal() +175
  System.Web.UI.Control.PreRenderRecursiveInternal() +175
  System.Web.UI.Control.PreRenderRecursiveInternal() +175
  System.Web.UI.Control.PreRenderRecursiveInternal() +175
  System.Web.UI.Control.PreRenderRecursiveInternal() +175
  System.Web.UI.Control.PreRenderRecursiveInternal() +175
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
  </code></pre>