【发布时间】:2016-11-23 12:26:04
【问题描述】:
我有使用 Windows 应用程序托管的 SignalR 应用程序。长话短说,我知道,使用自托管更容易。
它工作正常 - 但昨天,当我在 Visual Studio 中以调试模式运行它时,在尝试连接后,我收到了 400 错误返回The ConnectionId is in the incorrect format.。
我看了看日志——什么都没有。然后我启用了跟踪并发现了这个:
SignalR.HubDispatcher Information: 0 : Failed to process connectionToken: System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.
at System.Security.Cryptography.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope)
at System.Security.Cryptography.DpapiDataProtector.ProviderUnprotect(Byte[] encryptedData)
at System.Security.Cryptography.DataProtector.Unprotect(Byte[] encryptedData)
at Microsoft.Owin.Security.DataProtection.DpapiDataProtector.Unprotect(Byte[] protectedData)
at Microsoft.AspNet.SignalR.Infrastructure.DataProtectionProviderProtectedData.Unprotect(String protectedValue, String purpose)
at Microsoft.AspNet.SignalR.PersistentConnection.TryGetConnectionId(HostContext context, String connectionToken, String& connectionId, String& message, Int32& statusCode)
任何想法如何解决它?
我看了谷歌一个小时——每个人都在谈论网络农场、证书存储和负载均衡器。我没有这些,我相信。
我在 Windows 7 上使用 .NET 4.5 和 SignalR 2.2.1。浏览器和 VS 都是从同一个 Windows 帐户启动的,如果这很重要的话
【问题讨论】:
-
你在任何地方设置连接ID吗?
-
@AlexDresko 你的意思是在客户端?
-
@AlexDresko 在我们只读取的服务器上
Context.ConnectionId -
您在多少台网络服务器上运行您的服务?
-
@bsoulier 问题出在我的开发机器上。所以只有一台网络服务器
标签: .net signalr system.security