Fix: 'Unable to load one or more of the requested types' Errors

Fix: 'Unable to load one or more of the requested types' Errors

A long time ago, I reported on an intermittent ‘Could not load file or assembly‘ bug where ASP.NET 4 was encountering a bizarre error on start-up in System.Reflection.RuntimeModule.GetTypes(RuntimeModule module). I neglected to post a follow-up here.

The workaround is to always set the ContextTypeName property in your EntityDataSource. That is,  you should set the  ContextTypeName="ProjectNameNameSpace.EntityContainerName"

Here's an example of some mark-up:

<asp:EntityDataSource ID="edsCategoryTypesFilter" runat="server" ConnectionString="name=OfficeBookDBEntities1" 
ContextTypeName="OfficeBook.OfficeBookDBEntities1" DefaultContainerName="OfficeBookDBEntities1" 
OrderBy="it.CategoryName" EntitySetName="AccountTypeCategories" EntityTypeFilter="AccountTypeCategories"> 
</asp:EntityDataSource>

原文链接:http://weblogs.asp.net/kencox/archive/2011/06/08/fix-unable-to-load-one-or-more-of-the-requested-types-errors.aspx?CommentPosted=true#commentmessage



你可能感兴趣的:(server,Module,assembly,asp.net,asp,Types)