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

11 posts, 0 answers
  1. Timothy Kruszewski
    Timothy Kruszewski avatar
    76 posts
    Member since:
    Feb 2010

    Posted 20 Jul 2010 Link to this post

    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);
                       }
                   }
               }
           }
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 27 Jul 2010 Link to this post

    Hi Timothy,

    Thank you for the detailed problem report.

    I couldn't reproduce this error in test environment, but it looks like you're not the only one who gets this error.

    What are the chances that you have another application that runs in the same application pool and uses the Telerik assembly? Have you tried creating a new application pool exclusively for the problematic application?

    I hope this helps.

    All the best,
    Tsvetomir Tsonev
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Timothy Kruszewski
    Timothy Kruszewski avatar
    76 posts
    Member since:
    Feb 2010

    Posted 27 Jul 2010 Link to this post

    I have verified that each application on the server has it's own application pool and this is the error captured when loading my page with the Telerik Schdeduler.

    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)
  5. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 03 Aug 2010 Link to this post

    Hi Timothy,

    I've spent some more time trying to reproduce the problem, but without success.

    Maybe I'll have more luck with a stripped-down version of your project. Also, let me know under what version of IIS you're testing.

    Another thing that you might try in the meantime is to deploy the Telerik.Web.UI assembly in the GAC. One of the comments at SO suggests that this might help.

    Kind regards,
    Tsvetomir Tsonev
    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
  6. easten
    easten avatar
    1 posts
    Member since:
    Dec 2010

    Posted 20 Dec 2010 Link to this post

    the problem only occured when you bind the entitydatasource with some control in the design mode.
    the work around is try not to use entitydatasource. bind the entity with control through code behind.

    firstly, i never get this kind of error in my previous project, so after i got this kind of problem, i try to compare it to my old app.
    all the config and setting are the same. but i realize the problem occured after i install some additional feature for my telerik (i'm installing telerik winform)
    after some research, finally i found that some reference have brought up the problem.
    therefore, i try to remove several unused reference such as wpf,silverlight, etc.
    after i remove those reference my app work smoothly.
    (but i am curious why this kind of error could happen, actually the reference are the same with my previous app, maybe some assembly getting wrong after the installation)

    hope this help.
  7. Timothy Kruszewski
    Timothy Kruszewski avatar
    76 posts
    Member since:
    Feb 2010

    Posted 21 Dec 2010 Link to this post

    In my case I needed to delete all of the dll's from my working directory on my production server. 
  8. Dan
    Dan avatar
    9 posts
    Member since:
    Sep 2010

    Posted 01 Mar 2011 Link to this post


    Hi,


    I just found this link on the Microsoft Connect site: 
    http://connect.microsoft.com/VisualStudio/feedback/details/541962/unable-to-load-one-or-more-of-the-requested-types-connected-with-entitydatasource


    What finally did it for me was adding a ContextTypeName value to my EntityDataSource(s). For example, ContextTypeName="Employees.Data_Access.dbEmployeesEntities".


    Hope this helps,

    Dan

  9. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 18 Apr 2011 Link to this post

    In my case my development (working copy) server is 2008 R2 without Server ServicePack 1 and production server is with ServicePack1. So for a quick solution I configure every system references as "CopyLocal = true" and copy dlls to bin folder, and works. Another solution might be binding data at run time not with entitydatasource. I will try this later. So, in my case this is not a telerik related problem.
  10. Dan
    Dan avatar
    1 posts
    Member since:
    Feb 2012

    Posted 14 Mar 2012 Link to this post

    Dan, 
    Your solution worked for me.

    Alex
  11. Michael Nourani
    Michael Nourani avatar
    1 posts
    Member since:
    May 2006

    Posted 05 Jan 2015 Link to this post

    I know this is a very old issue. But I ran into it last night during a deployment and kept me up late.

    This Error usually refers to lines of code, totally unrelated to the missing type.

    The ERROR simply refers to inability to cycle through the type definition and it can happen during any call which requires type lookup in assemblies, in my case it was the first LINQ to SQL query in the app.

    I was missing some of the  Telerik.Reporting dlls.

    The reason it work in DEV environment, is because the types are loaded in the GAC and are accessible.

    Also see <a heref="http://stackoverflow.com/questions/1091853/error-message-unable-to-load-one-or-more-of-the-requested-types-retrieve-the-l"> this post </a>

  12. Prasad
    Prasad avatar
    1 posts
    Member since:
    Mar 2016

    Posted 28 Mar Link to this post

    One solution that worked for me was to delete the bin/ and obj/ folders and rebuild the solution.

    and insert Kendo.mvc.dll & KendoGridBinderEx.dll again, it will work

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017