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:

ContextTypeName="OfficeBook.OfficeBookDBEntities1" DefaultContainerName="OfficeBookDBEntities1" 
OrderBy="it.CategoryName" EntitySetName="AccountTypeCategories" EntityTypeFilter="AccountTypeCategories"> 

原文链接: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



你可能感兴趣的:(ASP.NET)