【问题标题】:Getting Error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information出现错误:无法加载一种或多种请求的类型。检索 LoaderExceptions 属性以获取更多信息
【发布时间】:2014-05-21 09:05:13
【问题描述】:

当我在服务器上上传我的网站时出现此错误。即使我在 Visual Studio 的本地服务器上运行它也可以正常工作。请帮我解决这个问题。我正在使用 Visual Studio 2012 和 sql server 2008 .还有一个项目文件夹外的包文件夹,可能我也需要上传数据..请帮助

错误我得到了:

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 96:          
    Line 97: 
    Line 98:         <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
    Line 99:      
    Line 100:<header>

    Source File: g:\pleskvhosts\hitchtechnologies.com\manshasweets.hitchtechnologies.com\MasterPage.master    Line: 98 

    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() +61
       AjaxControlToolkit.ToolkitScriptManagerConfig..cctor() in ToolkitScriptManagerConfig.cs:32

    [TypeInitializationException: The type initializer for 'AjaxControlToolkit.ToolkitScriptManagerConfig' threw an exception.]
       AjaxControlToolkit.ToolkitScriptManager..ctor() in ToolkitScriptManager.cs:114
       ASP.masterpage_master.__BuildControlToolkitScriptManager1() in g:\pleskvhosts\hitchtechnologies.com\manshasweets.hitchtechnologies.com\MasterPage.master:98
       ASP.masterpage_master.__BuildControlform1() in g:\pleskvhosts\hitchtechnologies.com\manshasweets.hitchtechnologies.com\MasterPage.master:93
       ASP.masterpage_master.__BuildControlTree(masterpage_master __ctrl) in g:\pleskvhosts\hitchtechnologies.com\manshasweets.hitchtechnologies.com\MasterPage.master:1
       ASP.masterpage_master.FrameworkInitialize() in g:\pleskvhosts\hitchtechnologies.com\manshasweets.hitchtechnologies.com\MasterPage.master.cs:912308
       System.Web.UI.UserControl.InitializeAsUserControlInternal() +32
       System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +655
       System.Web.UI.Page.get_Master() +54
       System.Web.UI.Page.ApplyMasterPage() +14
       System.Web.UI.Page.PerformPreInit() +45
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +335

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18056

这是我的 web.config。如果我做错了什么,请帮助我:

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <appSettings>

    <add key="connectionString" value="Data Source=Node-6-PC;Initial Catalog=dbMansha;user id=sa; password=hitch@123;"/>

    <add key="SiteFileFolder" value=""/>
  </appSettings>
  <system.web>
    <sessionState cookieless="false" regenerateExpiredSessionId="true" timeout="129600" />
    <globalization culture="en-GB"/>
    <compilation debug="true" targetFramework="4.5">

    </compilation>
    <httpRuntime maxRequestLength="12000" useFullyQualifiedRedirectUrl="true" executionTimeout="45"/>
    <authentication mode="Forms">

      <forms timeout="129600"/>
    </authentication>
    <membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
      </providers>
    </membership>
    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
      </providers>
    </profile>
    <roleManager enabled="false">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
      </providers>
    </roleManager>
  </system.web>

</configuration>

【问题讨论】:

  • 尝试将另一个模拟应用程序上传到使用 ajax 控制工具包的服务器,并验证它是否有效...
  • 它给了我同样的错误。
  • 你的 web.config 应该有如下所示的条目:stackoverflow.com/a/9231867/145682 如果在设计模式下你将 toolscriptmanager 拖到 aspx 页面上,它们应该会单独出现。

标签: c# asp.net ajax


【解决方案1】:

随便放

<system.web>
  <trust level="Full" />

【讨论】:

    【解决方案2】:

    需要将 ajax 4.5 更改为 4.0。并且工作了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-08
      • 2018-08-23
      • 2011-04-18
      • 2016-10-03
      相关资源
      最近更新 更多