【发布时间】:2013-03-01 21:09:56
【问题描述】:
我在使用 SignalR 时遇到了这个异常,部署在 Azure 网站中。它在调试环境中运行良好。它是 SignalR 1.0.1,我使用 .NET MVC 和 WebApi
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.
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.Security.Cryptography.CryptographicException: 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.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[CryptographicException: 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.]
Microsoft.Owin.Host.SystemWeb.<>c__DisplayClass1.<GetRethrowWithNoStackLossDelegate>b__0(Exception ex) +27
Microsoft.Owin.Host.SystemWeb.Utils.RethrowWithOriginalStack(Exception ex) +15
Microsoft.Owin.Host.SystemWeb.CallContextAsyncResult.End(IAsyncResult result) +47
Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.EndProcessRequest(IAsyncResult result) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629708
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
你有什么想法吗? 谢谢
【问题讨论】:
-
我猜您正在使用自定义依赖解析器,并且您没有注册正确的 IProtectedData,或者您在不应该注册的时候实现了注册。
-
我正在使用 Ninject,并且没有注册 IProtectedData。我是不是该 ?怎么样?
-
没关系,我去 Azure Cloud,谢谢
-
确定吗?我不确定“Azure Cloud”与这个问题有什么关系。无论如何,你做错了什么。您是否覆盖了注册?如果你这样做了,请不要这样做,它可能会在 azure 网站上运行。
-
我不知道如何,但它可以与 Azure 云计算一起使用。我没有覆盖注册。
标签: azure asp.net-web-api signalr azure-web-app-service signalr-hub