Unable to load one or more of the requested types in the Entity Framework

Disclaimer I saw the exact questions, but did not see the answers that could solve my problem.
Server : installed Windows Server 2008 with the ASP.NET 4.0 platform (client profile and advanced).
The script . This does not happen on my development server, it only happens on my production server, so my debugging capabilities are very limited. Problem. When I click on a page that loads data using EntityDataSource, I suggest this to me elmah.

System.Reflection.ReflectionTypeLoadException One or more of the requested types could not be loaded. Check out the LoaderExceptions property for more info.

There is no very useful stack trace. So I used the Application_Error event inside Global.asax like this to get more details about such an error.

 void Application_Error(object sender, EventArgs e) { // Code that runs when an unhandled error occurs StringBuilder sb = new StringBuilder(); Exception objErr = default(Exception); objErr = Server.GetLastError().GetBaseException(); Server.ClearError(); if (objErr is ReflectionTypeLoadException) { ReflectionTypeLoadException reflerror = default(ReflectionTypeLoadException); reflerror = (ReflectionTypeLoadException)objErr; foreach (var ex in reflerror.LoaderExceptions) { sb.AppendLine(ex.Message); } } sb.AppendLine("<b>Source:</b>" + Request.RawUrl); sb.AppendLine("<br><b>Browser:</b>" + Request.UserAgent); sb.AppendLine("<br><b>IP:</b>" + Request.UserHostAddress.ToString()); sb.AppendLine("<br><b>UserID:</b>" + User.Identity.Name); sb.AppendLine("<hr><br><b>Error in: </b>" + Request.Url.ToString()); sb.AppendLine("<br><b>Error Message: </b>" + objErr.Message.ToString()); sb.AppendLine("<br><b>Stack Trace: </b><br>" + objErr.StackTrace.ToString()); Elmah.ErrorSignal.FromCurrentContext().Raise(new Exception(sb.ToString())); } 

Now I get an error registered as

System.Exception
Failed to load file or assembly 'System.Web.Mvc, Version = 3.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' or one of its dependencies. The system cannot find the specified file. <b> Source: / consultant / Search
Browser: Mozilla / 5.0 (Windows NT 6.1; rv: 5.0) Gecko / 20100101 Firefox / 5.0
IP: my ip
UserID : user1020



Error in: http://mysite.com/search
Error message: Unable to load one or more of the requested types. Get LoaderExceptions for more information.
Stack trace:
on System.Reflection.RuntimeModule.GetTypes (RuntimeModule module) in System.Reflection.RuntimeModule.GetTypes () in System.Reflection.Assembly.GetTypes () in System.Data.Metadata.Edm.ObjectItemConventionAssemblyToL.Leading) .Metadata.Edm.ObjectItemAssemblyLoader.Load () in System.Data.Metadata.Edm.AssemblyCache.LoadAssembly (Assembly assembly, boolean loadReferencedAssemblies, ObjectItemLoadingSessionData collectionData , KnownAssembliesSet knownAssemblies, EdmItemCollection edmItemCollection, Action 1 logLoadMessage, Object& loaderCookie, Dictionary 2 & typesInLoading, List`1 & errors) in ... (tracing continues)

Look at the first line.

What is System.Web.Mvc, Version=3.0.0.0 in an ASP.NET System.Web.Mvc, Version=3.0.0.0 ?
I asked my server guys to install MVC3. But that really makes no sense.
Any hints / pointers would be much appreciated. I have not been so puzzled for a long time with asp.net :(

Why is this error happening and what would be a good solution / workaround?

+4
source share
1 answer

I had problems with third-party links that need MVC, DotNetOpenAuth comes to mind.

+3
source

All Articles