在创建 SessionCookies(FederatedAuthentication.SessionAuthenticationModule.WriteSessionTokenToCookie(sessionToken))时,我在身份服务器 4.5(最新版本)中出现以下错误“在加密操作期间发生错误”如果我在配置文件中设置机器密钥设置,则经过大量研发,而不是 TempData将在应用程序中丢失。以下是堆栈跟踪详细信息:
异常信息:异常类型:CryptographicException 异常消息:加密操作期间发生错误。在 System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.HomogenizeErrors(Func 2 func, Byte[] input)
at BrockAllen.CookieTempData.CookieTempDataProvider.LoadTempData(ControllerContext controllerContext) in c:\ballen\github\CookieTempData\45\BrockAllen.CookieTempData\CookieTempDataProvider.cs:line 37
at System.Web.Mvc.TempDataDictionary.Load(ControllerContext controllerContext, ITempDataProvider tempDataProvider)
at System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult
1.Begin(AsyncCallback 回调,对象状态,Int32 超时)在 System.Web.Mvc.Async.AsyncResultWrapper.Begin[TResult](AsyncCallback 回调,对象状态,BeginInvokeDelegate开始委托,结束调用委托1 endDelegate, Object tag, Int32 timeout)
at System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate endDelegate, Object tag)
at System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__2(AsyncCallback asyncCallback, Object asyncState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult
1.Begin(AsyncCallback callback, Object state, Int32 timeout) at System.Web.Mvc.Async.AsyncResultWrapper.Begin[TResult](AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate`1 endDelegate, Object tag, Int32 timeout) at System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate endDelegate, Object tag) 在 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) 在 System. Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep 步骤,布尔值&完成同步)。