简体   繁体   English

无法从程序集'System.Web,...'加载类型'...'

[英]Could not load type '…' from assembly 'System.Web, …'

<system.web>
    <profile defaultProvider="TestProfileProvider" inherits="Test.Library.UserAccountProvider.TestUserProfile">
      <providers>
        <add name="TestProfileProvider" type="Test.Library.UserAccountProvider.TestProfileProvider, , Test.Library.UserAccountProvider" connectionStringName="SecurityContext" applicationName="Sigma" applicationContext="XpressPago" />
      </providers>
    </profile>
    <membership defaultProvider="TestMembershipProvider">
      <providers>
        <add name="TestMembershipProvider" type="Test.Library.UserAccountProvider.TestMembershipProvider, Test.Library.UserAccountProvider" connectionStringName="SecurityContext" passwordFormat="Clear" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="3" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="Sigma" PasswordResetLimit="45" applicationContext="XpressPago" />
      </providers>
    </membership>
    <roleManager enabled="true" defaultProvider="TestRoleProvider">
      <providers>
        <add name="TestRoleProvider" type="Test.Library.UserAccountProvider.TestRoleProvider" connectionStringName="SecurityContext" applicationName="Sigma" applicationContext="XpressPago" />
      </providers>
    </roleManager>
    <httpRuntime executionTimeout="90" maxRequestLength="1048576" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100"/>
    <machineKey validationKey="196975F087819B74AC983A6D0882E5936BD0F30915A770C58E1177505D72D46F2D6F50BDB35DDF4E904AE01FD3E62726A6E63ADED231644D2D2E595A84AA76B2" decryptionKey="4496E865CAED30BA35BE7B60A06023CC3A13422F15060346" validation="SHA1" />
  </system.web>

TestMembershipProvider is not showing any error but TestUserProfile is showing the following error: TestMembershipProvider未显示任何错误,但TestUserProfile显示以下错误:

Could not load type 'Test.Library.UserAccountProvider.TestUserProfile' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 无法从程序集'System.Web,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'加载类型'Test.Library.UserAccountProvider.TestUserProfile'。

on statement return (TestUserProfile)Create(username); on语句return (TestUserProfile)Create(username);

Maybe you should add the full assembly name (", Test.Library.UserAccountProvider") at the end of 'type' attribute of the line with name="TestProfileProvider" if its the location of your class ? 也许你应该在行的'type'属性的末尾添加完整的程序集名称(“,Test.Library.UserAccountProvider”),如果你的类的位置是name =“TestProfileProvider”?

Like this : 像这样 :

  <add name="TestProfileProvider" type="Test.Library.UserAccountProvider.TestProfileProvider, Test.Library.UserAccountProvider" connectionStringName="SecurityContext" applicationName="Sigma" applicationContext="XpressPago" />

And the same for the 'inherits' attribute : 对于'inherits'属性也一样:

   <profile defaultProvider="TestProfileProvider" inherits="Test.Library.UserAccountProvider.TestUserProfile, Test.Library.UserAccountProvider">

I think Create does not where to pick the class since it tries in "System.Web". 我认为Create不会选择该类,因为它尝试“System.Web”。
Of course I suppose Test.Library.UserAccountProvider is the right assembly name, fix it if needed... 当然我认为Test.Library.UserAccountProvider是正确的程序集名称,如果需要可以修复它...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法从程序集 System.Web 加载类型“System.Web.HttpPostedFileBase” - Could not load type 'System.Web.HttpPostedFileBase' from assembly System.Web ASP.NET Core TypeLoadException无法从程序集“ System.Web”加载类型“ System.Web.PreApplicationStartMethodAttribute” - ASP.NET Core TypeLoadException Could not load type 'System.Web.PreApplicationStartMethodAttribute' from assembly 'System.Web' NUnit 测试错误:无法从程序集 'System.Web,版本 = 4.0.0.0 加载类型 'System.Web.HttpApplication' - NUnit Test Error: Could not load type 'System.Web.HttpApplication' from assembly 'System.Web, Version=4.0.0.0 无法从程序集“System.Web,版本=4.0.0.0,文化=中性,PublicKeyToken=b03f5f7f11d50 - Could not load type 'System.Web.UI.ParseChildrenAttribute' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50 无法从程序集“System.Web,版本=4.0.0.0,Cult=neutral,PublicKeyToken=b03f5f7f11d50a3a”加载类型“System.Web.UI.ParseChildrenAttribute” - Could not load type 'System.Web.UI.ParseChildrenAttribute' from assembly 'System.Web, Version=4.0.0.0, Cult=neutral, PublicKeyToken=b03f5f7f11d50a3a' 用户代码未处理System.Configuration.ConfigurationErrorsException,消息=无法加载文件或程序集&#39;System.Web - System.Configuration.ConfigurationErrorsException was unhandled by user code , Message=Could not load file or assembly 'System.Web System.IO.FileNotFoundException:无法在Mono for Android中加载程序集System.Web - System.IO.FileNotFoundException: Could not load assembly System.Web in Mono for Android System.TypeLoadException——无法从程序集 System.Web 加载 System.Web.Util? - System.TypeLoadException--can't load System.Web.Util from assembly System.Web? 无法在Windows 8 IIS上加载文件或程序集&#39;System.Web&#39;或其依赖项之一 - Could not load file or assembly 'System.Web' or one of its dependencies on Windows 8 IIS 无法加载文件或程序集“System.Web,Version = 4.0.0.0,Culture = neutral”或其依赖项之一。 访问被拒绝 - Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral' or one of its dependencies. Access is denied
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM