gpt4 book ai didi

c# - 应用重启后首次初始​​化 Membership.Provider 时出错

转载 作者:行者123 更新时间:2023-11-30 16:35:16 25 4
gpt4 key购买 nike

我们正在使用 MS Commerce Server 的 Microsoft.CommerceServer.Runtime.Profiles.UpmMembershipProvider,有时在应用重启后第一次初始化时,我们会收到此错误:

System.Configuration.ConfigurationErrorsException - System.Web, Object reference not set to an instance of an object. (C:\Inetpub\web.config line 425)
at System.Web.Security.Membership.Initialize()
at System.Web.Security.Membership.get_Provider()
...

第 425 行是成员(member)提供者规范:

<membership defaultProvider="UpmMembershipProvider">
<providers>
<clear />
<add name="UpmMembershipProvider"
applicationName="app"
enablePasswordRetrieval="false"
enablePasswordReset="true"
logonNameProperty="GeneralInfo.logon_name"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
enableCreateDate="true"
enableEmailAddress="true"
enableLastLoginDate="true"
profileDefinition="UserObject"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="1"
type="Microsoft.CommerceServer.Runtime.Profiles.UpmMembershipProvider" />
</providers>
</membership>

我们进行了内存转储,这就是我们得到的:

0:025> !dumpstack
OS Thread Id: 0x1080 (25)
Current frame: kernel32!RaiseException+0x53
ChildEBP RetAddr Caller,Callee
1213e5d8 7d4e237e kernel32!RaiseException+0x53, calling ntdll!RtlRaiseException
1213e5ec 79e8002c mscorwks!Binder::RawGetClass+0x20, calling mscorwks!Module::LookupTypeDef
1213e5fc 79e8068f mscorwks!Binder::IsClass+0x23, calling mscorwks!Binder::RawGetClass
1213e608 79ef2a0f mscorwks!Binder::IsException+0x14, calling mscorwks!Binder::IsClass
1213e618 79ef2a36 mscorwks!IsExceptionOfType+0x23, calling mscorwks!Binder::IsException
1213e620 79ef2bbc mscorwks!RaiseTheExceptionInternalOnly+0x2a8, calling kernel32!RaiseException
1213e668 79e81e3d mscorwks!SetObjectReferenceUnchecked+0x19
1213e680 79fccf80 mscorwks!JIT_Throw+0xfc, calling mscorwks!RaiseTheExceptionInternalOnly
1213e6b8 79295aea (MethodDesc 0x791aad5c +0xa System.Collections.CompatibleComparer.Equals(System.Object, System.Object)), calling (MethodDesc 0x791aad50 +0 System.Collections.CompatibleComparer.Compare(System.Object, System.Object))
1213e6d4 792e5fcd (MethodDesc 0x7910c3d0 +0xcd System.Collections.Hashtable.get_Item(System.Object))
1213e6f4 79fcced5 mscorwks!JIT_Throw+0x1e, calling mscorwks!LazyMachStateCaptureState
1213e70c 792861dc (MethodDesc 0x791a5f58 +0x1c System.RuntimeType.IsPrimitiveImpl()), calling mscorwks!TypeHandle::GetSignatureCorElementType
1213e724 7a57b600 (MethodDesc 0x7a4abadc +0x70 System.Configuration.SettingsBase.GetPropertyValueByName(System.String)), calling (MethodDesc 0x7a4ac288 +0 System.Configuration.SettingsPropertyValue.get_PropertyValue())
1213e744 66918ad7 (MethodDesc 0x65f9871c System.Web.Security.Membership.Initialize()), calling mscorwks!JIT_Throw
1213e7a0 6673ecb9 (MethodDesc 0x65f985a0 +0x5 System.Web.Security.Membership.get_Provider()), calling (MethodDesc 0x65f9871c +0 System.Web.Security.Membership.Initialize())
...

有没有人遇到过这样的事情?它不会在每次应用程序重新启动时发生,而且它似乎不在一个特定的服务器上(站点在负载均衡器后面的多个服务器上运行)

最佳答案

我在将 SQL Membership Provider 与 ASP.NET 一起使用时遇到了同样的问题。

这是一个配置问题。某些参数设置不正确。

也许这篇文章会对你有所帮助。

http://blogs.law.harvard.edu/brandonhaynes/2008/04/27/using-commerce-servers-upmmembershipprovider-with-dotnetnuke/

(此时)我能想到的是您的 type 属性有问题,或者您可能没有将所有必需的依赖项复制到您的 Bin..

祝你好运

关于c# - 应用重启后首次初始​​化 Membership.Provider 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1983552/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com