This is a migrated thread and some comments may be shown as answers.

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information

7 Answers 264 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Timothy Kruszewski
Top achievements
Rank 1
Timothy Kruszewski asked on 23 Jul 2010, 04:40 PM

 

I've been getting the error below on my production server only ever since I upgraded to the RADControls for ASP.NET Q2 release, file version 2010,2,713,40.  By adding the try/catch below I was able to indetify what assembly was causing the error

 "Could not load file or assembly 'Telerik.Web.UI, Version=2010.1.519.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

The problem is this assembly version does not exist on either my dev or production environment.  This happens everytime I make an update to my prod box and I can usually resolve it by resetting the app pool or resetting IIS but it doesn't always work the first time.  All of my projects are set up under the 4.0 framework and I've cleaned the solution several times but the issue persists.  Also, this error only occurs on pages that use the Entity Framwork to databind.  Any help would be greatly appreciated,

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
Exception Details: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
  
Source Error: 
  
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
  
Stack Trace: 
  
  
[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, Action`1 logLoadMessage, Object& loaderCookie, Dictionary`2& typesInLoading, List`1& errors) +166
   System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage) +316
   System.Data.Metadata.Edm.ObjectItemCollection.ExplicitLoadFromAssembly(Assembly assembly, EdmItemCollection edmItemCollection, Action`1 logLoadMessage) +53
   System.Data.Metadata.Edm.MetadataWorkspace.ExplicitLoadFromAssembly(Assembly assembly, ObjectItemCollection collection, Action`1 logLoadMessage) +93
   System.Data.Metadata.Edm.MetadataWorkspace.LoadFromAssembly(Assembly assembly, Action`1 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.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
  
  

try
       {       
           RadScheduler1.DataSource = TED.BLL.Appointment.Appointments(SafeValue.SafeInt(ddlView.SelectedValue),SafeValue.SafeInt(ddlCategory.SelectedValue),SafeValue.SafeInt(ddlClientName.SelectedValue),Users,RadScheduler1.VisibleRangeStart, RadScheduler1.VisibleRangeEnd);
           RadScheduler1.DataKeyField = "ID";
           RadScheduler1.DataStartField = "Start";
           RadScheduler1.DataEndField = "End";
           RadScheduler1.DataSubjectField = "Subject";
           RadScheduler1.DataDescriptionField = "Description";
           RadScheduler1.DataRecurrenceParentKeyField = "RecurrenceParentID";
           RadScheduler1.DataRecurrenceField = "RecurrenceRule";
           RadScheduler1.DataBind();
       }
       catch (Exception ex)
       {
           ReflectionTypeLoadException exception = ex as ReflectionTypeLoadException;
           if (exception == null)
           {
               using (TextWriter tw = new StreamWriter(Server.MapPath("~/Scheduler/EDSLog.txt")))
               {
                   tw.WriteLine("Not a ReflectionTypeLoadException ex.");
               }
           }
           else
           {
               foreach (Exception loaderException in exception.LoaderExceptions)
               {
                   using (TextWriter tw = new StreamWriter(Server.MapPath("~/Scheduler/EDSLog.txt")))
                   {
                       tw.WriteLine(loaderException.Message);
                       tw.WriteLine(loaderException.StackTrace);
                   }
               }
           }
       }

7 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 28 Jul 2010, 01:23 PM
Hi Timothy,

If yo have already followed the instructions from this help topic, then you can check if the version is updated in the GAC - Add/Remove RadControls to the Global Assembly Cache.

I hope this helps.


Greetings,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
kencox
Top achievements
Rank 1
answered on 25 Aug 2010, 03:32 AM
Timothy,

Did you get this resolved? 

I'm having a very similar problem and reported it on my blog and Microsoft Connect.

I haven't linked it to the Telerik controls. However, if they are involved, it would be helfpul to know.

Ken
0
Timothy Kruszewski
Top achievements
Rank 1
answered on 25 Aug 2010, 08:59 PM
No, I believe the problem is the entity framework and app pools in iis not working properly all of the time after updates are made,
0
ep2
Top achievements
Rank 1
answered on 06 Oct 2010, 07:33 AM
Hi there,

Could you please help me? Im kinda having hard time on my prob. Please Help me. Thanks a Lot....

Stack Trace:
 
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
      at System.Reflection.Module.GetTypesInternal(StackCrawlMark&stackMark)
      at System.Reflection.Assembly.GetTypes()
      at SteamAPI_Init()


0
Timothy Kruszewski
Top achievements
Rank 1
answered on 06 Oct 2010, 04:20 PM
I ended up deleting my working folder in IIS and copying the project in fresh.  I suspect there was something in one of the dll's that was holding an older version of the telerik controls and causing the intermitent problems.  Since doing this I have not had to reset IIs or an application pool.  Hope this helps.
0
kencox
Top achievements
Rank 1
answered on 06 Oct 2010, 04:29 PM
The workaround posted by a Microsoft person says, "Do not use one EntityDataSource for two controls. Create two EntityDataSource controls for two different controls."

Do any of the composite Telerik controls point two controls to the same Datasource?

0
Timothy Kruszewski
Top achievements
Rank 1
answered on 06 Oct 2010, 04:37 PM
No, this is the specific error I was able to capture by looping through the reflection error on the page.

Could not load file or assembly 'Telerik.Web.UI, Version=2010.1.309.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

try
            {
                rgFeedback.DataBind();
            }
            catch (Exception ex)
            {
                ReflectionTypeLoadException exception = ex as ReflectionTypeLoadException;
                if (exception == null)
                {
                    using (TextWriter tw = new StreamWriter(Server.MapPath("~/Feedback/EDSLog.txt")))
                    {
                        tw.WriteLine("Not a ReflectionTypeLoadException ex.");
                    }
                }
                else
                {
                    foreach (Exception loaderException in exception.LoaderExceptions)
                    {
                        using (TextWriter tw = new StreamWriter(Server.MapPath("~/Feedback/EDSLog.txt")))
                        {
                            tw.WriteLine(loaderException.Message);
                            tw.WriteLine(loaderException.StackTrace);
                        }
                    }
                }
            }
Tags
Scheduler
Asked by
Timothy Kruszewski
Top achievements
Rank 1
Answers by
Peter
Telerik team
kencox
Top achievements
Rank 1
Timothy Kruszewski
Top achievements
Rank 1
ep2
Top achievements
Rank 1
Share this question
or