SignalR 不适用于 Azure 移动服务 .NET 后端基本层

SignalR doesn't work with Azure Mobile Service .NET backend Basic Tier

在将我的移动服务后端从免费层级升级到基本层级时,我遇到了 SignalR 问题。我不断从客户那里得到的错误是:

01:48:22.5196201 - null - ChangeState(Disconnected, Connecting)
01:48:22.7613718 - d8633b78-1b64-49e0-8013-973986405a20 - WS Connecting to: wss://dev-sbp-ct.azure-mobile.net/signalr/connect?clientProtocol=1.4&transport=webSockets&connectionData=[{"Name":"scthub"}]&connectionToken=EMKwYVGq5cNqAzwXpHQzzKuu3Vq9q24%2B5SPCZKUBEPB8%2BF9jJSp4TDEpB9fO5vFn7Bo0WootRAHhY9R54jSIMQnkExGhwJ4YM1Kyzydd%2BrlTmuNROnI%2BB73t6OTX54f%2F
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.IO.IOException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
01:48:27.7842438 - d8633b78-1b64-49e0-8013-973986405a20 - Auto: Failed to connect to using transport webSockets. System.TimeoutException: Transport timed out trying to connect
A first chance exception of type 'System.ObjectDisposedException' occurred in mscorlib.dll
A first chance exception of type 'System.OperationCanceledException' occurred in mscorlib.dll
A first chance exception of type 'System.OperationCanceledException' occurred in mscorlib.dll
A first chance exception of type 'System.OperationCanceledException' occurred in mscorlib.dll
A first chance exception of type 'System.OperationCanceledException' occurred in System.dll
A first chance exception of type 'System.OperationCanceledException' occurred in mscorlib.dll
A first chance exception of type 'System.OperationCanceledException' occurred in mscorlib.dll
01:48:27.8032454 - d8633b78-1b64-49e0-8013-973986405a20 - SSE: GET https://dev-sbp-ct.azure-mobile.net/signalr/connect?clientProtocol=1.4&transport=serverSentEvents&connectionData=[{"Name":"scthub"}]&connectionToken=EMKwYVGq5cNqAzwXpHQzzKuu3Vq9q24%2B5SPCZKUBEPB8%2BF9jJSp4TDEpB9fO5vFn7Bo0WootRAHhY9R54jSIMQnkExGhwJ4YM1Kyzydd%2BrlTmuNROnI%2BB73t6OTX54f%2F
01:48:27.8847691 - d8633b78-1b64-49e0-8013-973986405a20 - WS: OnClose()
01:48:27.9207782 - d8633b78-1b64-49e0-8013-973986405a20 - SSE: OnMessage(Data: initialized)
A first chance exception of type 'System.InvalidOperationException' occurred in System.dll
A first chance exception of type 'System.InvalidOperationException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
01:48:32.8109745 - d8633b78-1b64-49e0-8013-973986405a20 - Auto: Failed to connect to using transport serverSentEvents. System.TimeoutException: Transport timed out trying to connect
A first chance exception of type 'System.IO.IOException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in mscorlib.dll
01:48:32.8209762 - d8633b78-1b64-49e0-8013-973986405a20 - LP Connect: https://dev-sbp-ct.azure-mobile.net/signalr/connect?clientProtocol=1.4&transport=longPolling&connectionData=[{"Name":"scthub"}]&connectionToken=EMKwYVGq5cNqAzwXpHQzzKuu3Vq9q24%2B5SPCZKUBEPB8%2BF9jJSp4TDEpB9fO5vFn7Bo0WootRAHhY9R54jSIMQnkExGhwJ4YM1Kyzydd%2BrlTmuNROnI%2BB73t6OTX54f%2F
The thread 0x111c has exited with code 259 (0x103).
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.IO.IOException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
01:48:37.8628968 - d8633b78-1b64-49e0-8013-973986405a20 - Auto: Failed to connect to using transport longPolling. System.TimeoutException: Transport timed out trying to connect
01:48:37.8709058 - d8633b78-1b64-49e0-8013-973986405a20 - Disconnected
01:48:37.8714054 - d8633b78-1b64-49e0-8013-973986405a20 - Transport.Dispose(d8633b78-1b64-49e0-8013-973986405a20)
01:48:37.8719060 - d8633b78-1b64-49e0-8013-973986405a20 - Closed
A first chance exception of type 'System.TimeoutException' occurred in mscorlib.dll
A first chance exception of type 'System.TimeoutException' occurred in mscorlib.dll
A first chance exception of type 'System.TimeoutException' occurred in mscorlib.dll
A first chance exception of type 'System.TimeoutException' occurred in mscorlib.dll
A first chance exception of type 'System.TimeoutException' occurred in mscorlib.dll 

我已经尝试使用 Signalr Client 版本 2.1.1,但它仍然没有帮助。当我将移动服务切换回免费层时,一切都开始工作。有人遇到过这个问题吗?

问题已在 Mobile Services Forums 中得到解答。

总结:如果您将移动服务扩展到基本或标准,移动服务将使用服务总线作为 SignalR 背板。如果通知中心命名空间被删除,您将看到此错误。要修复,请转到移动服务的“推送”选项卡,然后 select "Recreate Notification Hub"