Click here to Skip to main content
15,867,771 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
Server Error in '/' Application.

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: 

Line 251:                </center>
Line 252:    </div><br />
Line 253:     <asp:ToolkitScriptManager ID="toolKitScriptManager" runat="server">
Line 254:          </asp:ToolkitScriptManager>
Line 255:           <div>

Source File:asasas.aspx    Line: 253 

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
   AjaxControlToolkit.ToolkitScriptManagerConfig..cctor() +74

[TypeInitializationException: The type initializer for 'AjaxControlToolkit.ToolkitScriptManagerConfig' threw an exception.]
   AjaxControlToolkit.ToolkitScriptManagerConfig..ctor(IAjaxControlToolkitCacheProvider cacheProvider) +0
   AjaxControlToolkit.ToolkitScriptManager..ctor() +57
 .........
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

I am facing this problem only when i am uploading it on server otherwise on local machine it works fine
plzz help me out..

Thanx in advance
Posted
v2
Comments
Have you uploaded correctly? I guess you need to upload the Ajax Toolkit dlls also.
Have you done that?
Member 10202727 30-Oct-13 3:47am    
yes i had uploaded it .
its in bin directory.. :(
Okay try this. Clean the Project, then Build again. And after that upload all files and bin again. Then Reset the IIS. See if it solves the problem or not.
Member 10202727 30-Oct-13 3:57am    
Okey thanx if it works will let u know soon..
Member 10202727 1-Nov-13 5:09am    
hey its not working...
i had rebuild my solution uploaded it again still not working .. :(

put this code in web.config
and check out your version of an toolkit


XML
<configsections>
		
			<sectiongroup name="system.web.extensions">
        type="System.Web.Configuration.SystemWebExtensionsSectionGroup, 
      System.Web.Extensions, Version=3.5.0.0, Culture=neutral,  
      PublicKeyToken=31BF3856AD364E35">

      <sectiongroup name="scripting">
        type="System.Web.Configuration.ScriptingSectionGroup, 
        System.Web.Extensions, Version=3.5.0.0, Culture=neutral, 
        PublicKeyToken=31BF3856AD364E35">

        

        <sectiongroup name="webServices">
          type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
          System.Web.Extensions, Version=3.5.0.0, Culture=neutral, 
          PublicKeyToken=31BF3856AD364E35">

          

          
         

          

        </sectiongroup>
      </sectiongroup>
    </sectiongroup>

</configsections>


thank you
 
Share this answer
 
Add the following line in Web.Config file and it will work.....it works in my case coz i had same problem.

XML
<system.web>

   <trust level="Full" />
 
Share this answer
 
Comments
kingomer 3-Dec-20 3:19am    
This Works for me Thanks
You may solve this issue by setting the Copy Local attribute of your project's references to true!

Instructions

1- In Solution Explorer, click the Show All Files button to display the References node.
2- Open the References node for the project.
3- Right-click a reference in the References list, and click Properties.
The properties associated with that reference appear in a list in the Properties window.
4- Select Copy Local from the left-hand column, and then click the arrow in the right-hand column to change the value to True or False.

You may also use the following code to identify what is missing

C#
<pre lang="c#">
using System.IO;
using System.Reflection;
using System.Text;

try
{
//The code that causes the error goes here.
}
catch (ReflectionTypeLoadException ex)
{
StringBuilder sb = new StringBuilder();
foreach (Exception exSub in ex.LoaderExceptions)
{
sb.AppendLine(exSub.Message);
FileNotFoundException exFileNotFound = exSub as FileNotFoundException;
if (exFileNotFound != null)
{
if(!string.IsNullOrEmpty(exFileNotFound.FusionLog))
{
sb.AppendLine("Fusion Log:");
sb.AppendLine(exFileNotFound.FusionLog);
}
}
sb.AppendLine();
}
string errorMessage = sb.ToString();
//Display or log the error based on your application.
}



References
msdn, stack overflow.
 
Share this answer
 
Change the asp:ToolkitScriptManager to

XML
<asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server">
</asp:ScriptManager>
 
Share this answer
 
Comments
Ankita1391 18-Dec-15 4:23am    
it worked for me!
If it works on your local machine, the issue is that you have not copied the dlls to the server.
 
Share this answer
 
Comments
Member 10202727 24-Jan-14 1:31am    
I had copied still it was not working then i tried this piece of code
then i tried to use this webservice...
Christian Graus 24-Jan-14 3:21am    
The error means what it says. The files are not there.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900