在努力将 virto commerce 成功部署到 Azure 并为新用户激活电子邮件确认后,我一直遇到加密异常:
The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.
at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope)
at VirtoCommerce.Web.Client.Providers.CookieTempDataProvider.Protect(Byte[] data) in c:\Users\Tiago\Documents\xpmarketplace\src\Extensions\Client\CommerceWebClient\Providers\CookieTempDataProvider.cs:line 91
at VirtoCommerce.Web.Client.Providers.CookieTempDataProvider.SaveTempData(ControllerContext controllerContext, IDictionary`2 values) in c:\Users\Tiago\Documents\xpmarketplace\src\Extensions\Client\CommerceWebClient\Providers\CookieTempDataProvider.cs:line 28
at System.Web.Mvc.TempDataDictionary.Save(ControllerContext controllerContext, ITempDataProvider tempDataProvider)
at System.Web.Mvc.Controller.PossiblySaveTempData()
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)
在谷歌搜索异常文本后,我遇到了一些指南,提示我应该在 IIS AppPool 中将 Load User Profile 设置为 True,我尝试这样做只是为了发现它默认情况下已经是 true。
编辑:系统生成任何令牌(帐户激活,重置密码)时引发异常。