asp.net – SignalR 2在Azure上失败

我在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()的调用.希望这有助于某人.

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....