gpt4 book ai didi

asp.net - SignalR 2 在 Azure 上失败

转载 作者:行者123 更新时间:2023-12-04 15:32:19 25 4
gpt4 key购买 nike

我在 Azure 上部署了 ASP.NET 5 MVC 6 应用程序,并在使用 SignalR 2 时遇到了此问题:当从客户端启动连接时,调用

/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B"name"%3A"gameHub"%7D%5D&_=1460028930688

失败并出现错误 500。

错误 500 背后的异常是这样的:

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.

来源错误:

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.

堆栈跟踪:

[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.]

我阅读并尝试了 SignalR CryptographicException on AzureWebsites 中建议的解决方案,但 id 对我不起作用。

据我了解,Azure 不允许 LoadUserProfile。

有什么解决办法吗?

最佳答案

我遇到了同样的问题,我的修复是在调用 MapSignalR() 之前添加对 UseAesDataProtectorProvider() 的调用。希望这对某人有帮助。

关于asp.net - SignalR 2 在 Azure 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36475209/

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