+1-888-365-2779
Try Now
More in this section

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

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

50 posts, 0 answered
  1. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    30 Nov 2016
    29 Aug 2011
    Link to this post
    Hello Cranaboldo,

    The dll`s will be missing when you rebuild or clean the solution, use Build instead to avoid their deletion. This is a problem related to Sitefinity 4.1. Also there may be other factors that cause it for a specific scenario. The solution is to carefully examine bin folder and references so that it is sure no files are missing.

    Regards,
    Stanislav Velikov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  2. Antoine
    Antoine avatar
    45 posts
    Registered:
    13 Jul 2012
    22 Sep 2011
    Link to this post
    I recently ran into this error after copying some files into my \bin folder and then trying to compile.  Some specifics about my case:
    - I had custom module projects that were not compiling due to the error.
    - I had copied the files into the folder through windows explorer, not Visual Studio.

    I found that refreshing my bin folder in Visual Studio resolved the issue.
  3. Antoine
    Antoine avatar
    45 posts
    Registered:
    13 Jul 2012
    22 Sep 2011
    Link to this post
    Well, I thought I got by the issue.  Turns out I lied and am now getting the error when compiling again.  This all started for me when I added the Sitefinity 4.2 Hotfix dll's to my project.  It really was as simple as replacing 4 Sitefinity dll's.

    Questions that run through my mind:
    - Why is simply replacing those 4 DLL's causing problems?
    - Why do my custom module projects not compile but my other projects do?  Is this an Open Access issue?  I have other projects that reference the Open Access binaries, though they are not using it.
    - Might my custom module projects be trying to compile with caches dll's that I cannot track down?  I ran Process Monitor to observe file system activity for files named Telerik.Sitefinity.Utilities.dll while building.  The only place I see such a file being accessed is in the website project bin folder.
    -  Any idea on how I can "check the Retrieve the LoaderExceptions property" when I am compiling?  My web searches are not giving me the answer.

    Any help would be greatly appreciated.  This is so hard to diagnose.

    Thanks,
    Antoine
  4. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    30 Nov 2016
    27 Sep 2011
    Link to this post
    Hello Antoine,

    The issue with Unable to load one or more of the requested types dates back to Sitefinity 4.1.1339. With version after 4.1.1574 I was unable to reproduce it at my end. This was caused by missing assemblies. All assemblies were shown as referenced, but in the bin folder the physical files was deleted and it had to be manually added.
    If you can send me a problematic project I can review it at my end and tell you which assembly is missing.

    Greetings,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Levent
    Levent avatar
    8 posts
    Registered:
    23 Aug 2011
    04 Oct 2011
    Link to this post
    I have the same problem. I have a radgrid and entitydatasource. First I removed entitydatasource and placed again. It seems fine but I dont understand whats happened.

    Thanks,
    Levent
  6. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    30 Nov 2016
    06 Oct 2011
    Link to this post
    Hi Levent,

    Can you give me some additional information regarding the steps you took to get "Unable to load one or more of the requested types" error. Just adding additional functionality to a widget should not lead to this error. Have you cleaned or Rebuilt the Visual Studio solution before getting the error?

     Following the previous posts you can see there are some suggestions to resolve the issue, have you tried them out? What was the result?

    Greetings,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    11 Oct 2011
    Link to this post
    I encountered this issue after upgrading from Sitefinity 4.1 SP2 to Sitefinity 4.2. I compared the bin folder my upgraded project to one that was created through Sitefinity 4.2 directly and noticed a huge disparity between the dll's that are in the bin folders. Should I make them uniform? If so, which should be my basis?
  8. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    30 Nov 2016
    12 Oct 2011
    Link to this post
    Hello Jkregala,

    There are difference in the number of assemblies used in Sitefinity 4.1 and 4.2. For example OpenAccess.AdoNet is no longer used and there are new analytics assemblies and migration module assembly.

    If want to use Sitefinity 4.1 refer to working 4.1 projects.
    If your project is using Sitefinity 4.2 refer to Sitefiniy 4.2 projects because of the difference in assemblies.(Sitefinity 4.1 will still search for OpenAccess.AdoNet.dll)

    All the best,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    12 Oct 2011
    Link to this post
    Hi Stanislav,

    I just made sure that the DLL's in my upgraded project are equal to the DLL's present in the bin folder of _EmptyProject in the installation directory for Sitefinity 4.2. It seems to work fine.

    Is this a safe practice?

    Thanks.
  10. Levent
    Levent avatar
    8 posts
    Registered:
    23 Aug 2011
    14 Oct 2011
    Link to this post
    After tried many solutions I think I solved the problem but  is not about sitefinity 4.2

    Its all about missing dll's. If I am not wrong no one gets "compile error" or missing dll messages. 

    Common problem is "entity framework" references. 

    You should set : Use Local Copy = True for project references.

    If you cant find these setting on your project open your project folder and edit your csproj file.

    You should see tags and correct False to True   <Private>False</Private> ( for entity framework lines.)

    How to use Local Copy = True
    http://msdn.microsoft.com/en-us/library/t1zz5y8c.aspx

    Should read these
    http://connect.microsoft.com/VisualStudio/feedback/details/541962/unable-to-load-one-or-more-of-the-requested-types-connected-with-entitydatasource

    I did not try that but may be useful. someone tried and got the solution.
    http://brianseekford.com/index.php/2011/08/01/unable-to-load-one-or-more-of-the-requested-types-when-using-entitydatasource-with-entity-framework-in-asp-net/
     
    http://www.telerik.com/community/forums/aspnet-ajax/grid/what-is-an-alternative-for-entitydatasource.aspx

    If works or not please post it here. 

    Hope this  help...

    Levent










  11. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    30 Nov 2016
    17 Oct 2011
    Link to this post
    Hi
    @ Jan
    Yes this is a safe practice because when you create a new project with the project manager the bins that are added to it are coming from this _Empty project.

    @Levent

    The info you have linked to is correct, but in the case when using EntityFramework and Sitefinity uses OpenAccess as an ORM tool. The solution described by Jan is an easier and will get your project up and running.


    Greetings,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  12. mario
    mario avatar
    23 posts
    Registered:
    08 Aug 2011
    09 Nov 2011
    Link to this post
    @Levent

    I want to thank you, Levent, your links help me to solve this annoying issue.
    Just by setting the ContextTypeName property in the EntityDataSource, the error was gone!

    <asp:EntityDataSource ID="EventosDS" runat="server"
                ConnectionString="name=StMartinEntities"
                DefaultContainerName="StMartinEntities" EnableDelete="True"
                EnableFlattening="False" EntitySetName="Eventos"
                ContextTypeName="SitefinityWebApp.Data.StMartinEntities">
            </asp:EntityDataSource>

    my issue was the typical exception page:
    Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

    now with the "ContextTypeName="SitefinityWebApp.Data.StMartinEntities" property all is working fine :D

    Thanks you very much!


    -Mario-
  13. Dave
    Dave avatar
    29 posts
    Registered:
    31 Oct 2011
    12 Nov 2011
    Link to this post
    All,

    I spent about half an hour with this issue this morning (Sitefinity v4.3) and happen to come across this thread, so I thought I'd share my solution.

    "Could not load type" and related errors nearly always arise due to a missing DLL. In my case, that was caused by using "Clean Solution" from within Visual Studio, but it can also happen when deploying a project to another server.

    An easy fix for this is to make sure that *all* of the DLLs in your BIN folder are added as a reference to your VS project. Some of the DLLs that Sitefinity seems to require aren't explicitly referenced in the default project, probably because they're required by other DLLs but not by the project itself.

    However, if you explicitly add references to those DLLs, they won't be deleted from the bin folder when cleaning the solution, and they should be copied along with everything else when deploying the site.

    Hope this helps someone!

  14. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    30 Nov 2016
    16 Nov 2011
    Link to this post
    Hello David,

    Thank you for sharing your experience. This is exactly the case. When you perform clean or Rebuild Visual Studio actually removes all references from bin folder and tries to reference them again. If they are referenced from another project re-referencing them might not be possible and thus they are not added again. This produces an error message.

    Greetings,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  15. Samir Vaidya
    Samir Vaidya avatar
    261 posts
    Registered:
    05 Feb 2005
    25 Nov 2011
    Link to this post
    Adding the ContextTypeName attribute to my EntityDataSource also resolved my problem!

    The format that was required was the following:  
    ContextTypeName="<namespace of DLL>.<Entity Set Name>"

    Therefore, in my case, it was ContextTypeName="TTAEntities.TroyAcademyEntities"

    Thanks again!

  16. Abhilash Shamsunder
    Abhilash Shamsunder avatar
    10 posts
    Registered:
    05 Apr 2010
    02 Feb 2012
    Link to this post
    I came across a similiar kinda issue and this happened when I rebuilt the solution and below is the explanation I took to resolve it:

    Sitefinity 4.4
    I am not sure if you observed the output carefully when you build the solution or the sitefinity web app. These were just Warnings. Below is what I found:

    c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3396,9): warning MSB3061: Unable to delete file "C:\Clients\Web\bin\Telerik.Sitefinity.xml". Access to the path 'C:\Clients\Web\bin\Telerik.Sitefinity.xml' is denied.
    c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3396,9): warning MSB3061: Unable to delete file "C:\Clients\Web\bin\Telerik.Web.UI.xml". Access to the path 'C:\Clients\Web\bin\bin\Telerik.Web.UI.xml' is denied.
    c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3396,9): warning MSB3061: Unable to delete file "C:\Clients\Web\bin\Telerik.Sitefinity.Model.xml". Access to the path 'C:\Clients\Web\bin\Telerik.Sitefinity.Model.xml' is denied.

    1) Just to be safe restart the visual studio. This is just to make sure none of the files in bin folder are locked to VS process.
    2) When you view bin folder properties - I saw read only option checked. Firstly, you need to have read/write permissions for this folder especially for the Network Service. But, I had given read/write permissions for network service for App_Data and bin folder which seemed to have changed.
    3) Make sure your Source Control did not make the files read only on edit. In my case I did a complete project checkout for edit just to avoid any possible issues.
    4) Got Latest on the bin folder from source.
    Doing the above things fixed the issue. Hope this helps you.

    Thanks!
  17. Berrabah
    Berrabah avatar
    25 posts
    Registered:
    12 Feb 2012
    06 Mar 2012
    Link to this post

    Hello
    I was still working on sitefinity,I rebooted it so I got this error :

    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.

    I need a sooner solution please 
  18. Berrabah
    Berrabah avatar
    25 posts
    Registered:
    12 Feb 2012
    06 Mar 2012
    Link to this post
    Please I need a solution for the bug
  19. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    30 Nov 2016
    08 Mar 2012
    Link to this post
    Hi,

     As stated in this topic the solution is to re-reference all assemblies for the project in visual studio. The easiest way is:
    1. Copy all Sitefinity assemblies in a random folder on your hard drive. (take them from a working project)
    2. In visual studio expand References section and delete all Sitefinity references.
    3. Add the references from the folder you have created in step 1 to the project.
    4. Build the project (F6), don`t rebuild or clean
    5. The references are correct now an no assembly is missing.

    Greetings,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  20. Berrabah
    Berrabah avatar
    25 posts
    Registered:
    12 Feb 2012
    08 Mar 2012
    Link to this post
    It works ! thankx for help 
50 posts, 0 answered
1 2