【问题标题】:SignalR connection to Azure not working (.net core 3.1)SignalR 与 Azure 的连接不起作用(.net core 3.1)
【发布时间】:2020-05-23 22:09:52
【问题描述】:

我正在尝试将我的应用程序与 Azure SignalR 连接,但似乎没有建立连接。

当我在我的基本配置文件中使用并在本地运行程序时,一切正常:

services.AddSignalR();

但是当我像这样将它更改为 Azure 时(我在这里硬编码了密钥)

services.AddSignalR().AddAzureSignalR("Endpoint=https://frenscoservice.service.signalr.net;AccessKey=<MYKEY>;Version=1.0;");

我在客户端收到错误提示

“加载资源失败:服务器响应状态为 500(内部服务器错误)”

“错误:无法完成与服务器的协商:错误:内部服务器错误”

我设法在下面获取了完整的服务器日志文件。任何指针将不胜感激。 我仍然可以选择默认运行 SignalR 而不是使用 Azure,但我在 SignalR 上调用了数千次,Azure 似乎解释说使用他们的服务会更快。

Starting IIS Express ...
Successfully registered URL "http://localhost:61663/" for site "Traveller" application "/"
Successfully registered URL "https://localhost:44380/" for site "Traveller" application "/"
Registration completed for site "Traveller"
IIS Express is running.
dbug: Microsoft.AspNetCore.SignalR.Internal.DefaultHubProtocolResolver[1]
      Registered SignalR Protocol: json, implemented by Microsoft.AspNetCore.SignalR.Protocol.JsonHubProtocol.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[1]
      Starting HttpConnection.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[7]
      Starting transport 'WebSockets' with Url: https://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=3ecd8966-8daa-4086-9814-c31f11ba7e66.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[1]
      Starting transport. Transfer mode: Binary. Url: 'wss://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=3ecd8966-8daa-4086-9814-c31f11ba7e66'.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[1]
      Starting HttpConnection.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[7]
      Starting transport 'WebSockets' with Url: https://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=3809c62f-7960-4596-af76-f96589bc9e27.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[1]
      Starting transport. Transfer mode: Binary. Url: 'wss://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=3809c62f-7960-4596-af76-f96589bc9e27'.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[1]
      Starting HttpConnection.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[7]
      Starting transport 'WebSockets' with Url: https://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=3bfd6373-814e-4f54-a86f-0f187e34ea55.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[1]
      Starting transport. Transfer mode: Binary. Url: 'wss://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=3bfd6373-814e-4f54-a86f-0f187e34ea55'.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[1]
      Starting HttpConnection.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[7]
      Starting transport 'WebSockets' with Url: https://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=f128631e-ff15-4882-82a8-9aeaf47db2ee.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[1]
      Starting transport. Transfer mode: Binary. Url: 'wss://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=f128631e-ff15-4882-82a8-9aeaf47db2ee'.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[1]
      Starting HttpConnection.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[7]
      Starting transport 'WebSockets' with Url: https://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=ebab1e46-a273-4e83-8649-39aad83c18ce.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[1]
      Starting transport. Transfer mode: Binary. Url: 'wss://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=ebab1e46-a273-4e83-8649-39aad83c18ce'.
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using 'C:\Users\francois.debodinat\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
Hosting environment: Development
Content root path: C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller
Now listening on: http://localhost:61663/
Now listening on: https://localhost:44380/
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/  
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint 'Traveller.Controllers.DefinitionController.Index (Traveller)'
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[3]
      Route matched with {action = "Index", controller = "Definition"}. Executing controller action with signature Microsoft.AspNetCore.Mvc.IActionResult Index() on controller Traveller.Controllers.DefinitionController (Traveller).
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[19]
      Started transport.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[19]
      Started transport.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[19]
      Started transport.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[19]
      Started transport.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[19]
      Started transport.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[18]
      Transport 'WebSockets' started.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[18]
      Transport 'WebSockets' started.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[18]
      Transport 'WebSockets' started.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[18]
      Transport 'WebSockets' started.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[18]
      Transport 'WebSockets' started.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[3]
      HttpConnection Started.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[3]
      HttpConnection Started.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[3]
      HttpConnection Started.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[3]
      HttpConnection Started.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[3]
      HttpConnection Started.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[13]
      Received message from application. Payload size: 4.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[13]
      Received message from application. Payload size: 4.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[13]
      Received message from application. Payload size: 4.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[13]
      Received message from application. Payload size: 4.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[13]
      Received message from application. Payload size: 4.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[12]
      Message received. Type: Binary, size: 48, EndOfMessage: True.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[12]
      Message received. Type: Binary, size: 48, EndOfMessage: True.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[12]
      Message received. Type: Binary, size: 48, EndOfMessage: True.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[12]
      Message received. Type: Binary, size: 48, EndOfMessage: True.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[12]
      Message received. Type: Binary, size: 48, EndOfMessage: True.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[11]
      WebSocket closed by the server. Close status NormalClosure.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[11]
      WebSocket closed by the server. Close status NormalClosure.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[11]
      WebSocket closed by the server. Close status NormalClosure.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[11]
      WebSocket closed by the server. Close status NormalClosure.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[11]
      WebSocket closed by the server. Close status NormalClosure.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[4]
      Receive loop stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[4]
      Receive loop stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[4]
      Receive loop stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[4]
      Receive loop stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[4]
      Receive loop stopped.
crit: Microsoft.Azure.SignalR.ServiceConnection[24]
      Service returned handshake error: Maximum message count limit reached: 20000. Id: 3bfd6373-814e-4f54-a86f-0f187e34ea55
crit: Microsoft.Azure.SignalR.ServiceConnection[24]
      Service returned handshake error: Maximum message count limit reached: 20000. Id: f128631e-ff15-4882-82a8-9aeaf47db2ee
crit: Microsoft.Azure.SignalR.ServiceConnection[24]
      Service returned handshake error: Maximum message count limit reached: 20000. Id: 3809c62f-7960-4596-af76-f96589bc9e27
crit: Microsoft.Azure.SignalR.ServiceConnection[24]
      Service returned handshake error: Maximum message count limit reached: 20000. Id: 3ecd8966-8daa-4086-9814-c31f11ba7e66
crit: Microsoft.Azure.SignalR.ServiceConnection[24]
      Service returned handshake error: Maximum message count limit reached: 20000. Id: ebab1e46-a273-4e83-8649-39aad83c18ce
fail: Microsoft.Azure.SignalR.StrongServiceConnectionContainer[2]
      Hub 'NotificationsHub' is now disconnected from '(Primary)https://frenscoservice.service.signalr.net'. Please check log for detailed info.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[4]
      Disposing HttpConnection.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[4]
      Disposing HttpConnection.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[4]
      Disposing HttpConnection.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[4]
      Disposing HttpConnection.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[4]
      Disposing HttpConnection.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[6]
      Transport is stopping.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[6]
      Transport is stopping.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[6]
      Transport is stopping.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[6]
      Transport is stopping.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[6]
      Transport is stopping.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[8]
      Send loop stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[8]
      Send loop stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[8]
      Send loop stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[8]
      Send loop stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[8]
      Send loop stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[2]
      Transport stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[2]
      Transport stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[2]
      Transport stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[2]
      Transport stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[2]
      Transport stopped.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[6]
      HttpConnection Disposed.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[6]
      HttpConnection Disposed.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[6]
      HttpConnection Disposed.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[6]
      HttpConnection Disposed.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[6]
      HttpConnection Disposed.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[1]
      Starting HttpConnection.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[7]
      Starting transport 'WebSockets' with Url: https://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=b81c6688-9239-4342-897f-86c3bd7f7c6d.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[1]
      Starting transport. Transfer mode: Binary. Url: 'wss://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=b81c6688-9239-4342-897f-86c3bd7f7c6d'.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[19]
      Started transport.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[18]
      Transport 'WebSockets' started.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[3]
      HttpConnection Started.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[13]
      Received message from application. Payload size: 4.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[12]
      Message received. Type: Binary, size: 48, EndOfMessage: True.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[11]
      WebSocket closed by the server. Close status NormalClosure.
crit: Microsoft.Azure.SignalR.ServiceConnection[24]
      Service returned handshake error: Maximum message count limit reached: 20000. Id: b81c6688-9239-4342-897f-86c3bd7f7c6d
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[4]
      Receive loop stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[4]
      Disposing HttpConnection.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[6]
      Transport is stopping.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[8]
      Send loop stopped.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[2]
      Transport stopped.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[6]
      HttpConnection Disposed.
info: Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor[1]
      Executing ViewResult, running view Index.
info: Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor[4]
      Executed ViewResult - view Index executed in 235.3981ms.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/lib/css/bootstrap.css  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/lib/js/jquery-3.3.1.js?2300  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/lib/js/jquery-3.3.1.min.js?2500  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/js/JSKonvaSearch.js?2000  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/lib/js/bootstrap.bundle.js?2400  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/js/signalr/signalr.js?2800  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/js/JSUtils.js?2000  
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[2]
      Executed action Traveller.Controllers.DefinitionController.Index (Traveller) in 1169.127ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint 'Traveller.Controllers.DefinitionController.Index (Traveller)'
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/js/JSGlobals.js?2000  
info: Microsoft.AspNetCore.Session.DistributedSession[3]
      Session started; Key:7337807d-0554-d5b7-e2b1-bb23dae40b59, Id:d2077465-8aea-9f6f-2e81-7d3074ea87e2
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/js/JSKonvaSearch.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\js\JSKonvaSearch.js'
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/js/JSGlobals.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\js\JSGlobals.js'
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/js/JSUtils.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\js\JSUtils.js'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 19.3002ms 200 application/javascript
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 59.6407ms 200 application/javascript
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 58.1304ms 200 application/javascript
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/lib/js/bootstrap.bundle.min.js?2600  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/js/JSKonvaDraw.js?2000  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/lib/js/konva.2.4.2.min.js?2200  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/lib/js/Chart.bundle.v2.7.3.min.js?2800  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/js/JSDashboard.js?2000  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/css/site.css  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/js/signalr/signalr.min.js?2850  
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 1308.065ms 200 text/html; charset=utf-8
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/js/JSKonvaDraw.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\js\JSKonvaDraw.js'
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/lib/js/jquery-3.3.1.min.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\lib\js\jquery-3.3.1.min.js'
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/lib/js/bootstrap.bundle.min.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\lib\js\bootstrap.bundle.min.js'
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/js/JSDashboard.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\js\JSDashboard.js'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 52.7555ms 200 application/javascript
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/lib/js/Chart.bundle.v2.7.3.min.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\lib\js\Chart.bundle.v2.7.3.min.js'
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/js/signalr/signalr.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\js\signalr\signalr.js'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 40.9507ms 200 application/javascript
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 50.1708ms 200 application/javascript
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/lib/css/bootstrap.css'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\lib\css\bootstrap.css'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 71.0605ms 200 application/javascript
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 155.159ms 200 text/css
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/lib/js/bootstrap.bundle.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\lib\js\bootstrap.bundle.js'
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/lib/js/jquery-3.3.1.js  
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/lib/js/konva.2.4.2.min.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\lib\js\konva.2.4.2.min.js'
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/lib/js/bootstrap.bundle.js  
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 171.1148ms 200 application/javascript
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 101.9239ms 200 application/javascript
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/js/signalr/signalr.min.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\js\signalr\signalr.min.js'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 94.194ms 200 application/javascript
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 210.5455ms 200 application/javascript
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 217.9566ms 200 application/javascript
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/css/site.css'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\css\site.css'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 149.158ms 200 text/css
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/lib/js/jquery-3.3.1.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\lib\js\jquery-3.3.1.js'
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/lib/js/jquery-3.3.1.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\lib\js\jquery-3.3.1.js'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 244.3982ms 200 application/javascript
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/lib/js/bootstrap.bundle.js'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\lib\js\bootstrap.bundle.js'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 80.9432ms 200 application/javascript
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 80.7803ms 200 application/javascript
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 GET https://localhost:44380/images/image_welcome_background_xsmall.jpg  
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/images/image_welcome_background_xsmall.jpg'. Physical path: 'C:\Users\francois.debodinat\Documents\_perso code\ProjectTraveller\Traveller\wwwroot\images\image_welcome_background_xsmall.jpg'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 24.7034ms 200 image/jpeg
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2.0 POST https://localhost:44380/hubs/notifications/negotiate?negotiateVersion=1 text/plain;charset=UTF-8 0
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint '/hubs/notifications/negotiate'
crit: Microsoft.Azure.SignalR.ServiceRouteHelper[1]
      Client negotiate failed: Azure SignalR Service is not connected yet, please try again later.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint '/hubs/notifications/negotiate'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 48.5865ms 500 
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[1]
      Starting HttpConnection.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[7]
      Starting transport 'WebSockets' with Url: https://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=535de32b-cedb-4cda-9959-675e6712f6ac.
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[1]
      Starting transport. Transfer mode: Binary. Url: 'wss://frenscoservice.service.signalr.net/server/?hub=notificationshub&cid=535de32b-cedb-4cda-9959-675e6712f6ac'.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[19]
      Started transport.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[18]
      Transport 'WebSockets' started.
info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[3]
      HttpConnection Started.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[13]
      Received message from application. Payload size: 4.
dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[12]
      Message received. Type: Binary, size: 48, EndOfMessage: True.
crit: Microsoft.Azure.SignalR.ServiceConnection[24]
      Service returned handshake error: Maximum message count limit reached: 20000. Id: 535de32b-cedb-4cda-9959-675e6712f6ac
info: Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[11]
      WebSocket closed by the server. Close status NormalClosure.
dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[4]
      Disposing HttpConnection.
etc.

【问题讨论】:

  • 您使用的是什么版本的 SignalR 客户端?
  • 在尝试连接 Azure SignalR 服务时,Service returned handshake error: Maximum message count limit reached: 20000 似乎表明了最可能的原因,我建议检查 SignalR 服务。
  • 达到免费层的限制,你可能需要升级到标准
  • @KalZekdor 在客户端使用 SignalR 版本 v4.2.2+97478eb6(min 和 js 版本)。不过,您的观点是正确的,我昨天确实达到了 20,000 条消息的限制。我的应用程序发送的数量远不止这些,所以我必须尽量减少 nb 的请求。

标签: azure .net-core signalr


【解决方案1】:

这发生在我的 sprint 审查当天,当时我们达到了免费层级 Azure SignalR 服务的最大消息数。正如您在日志中看到的,您重新考虑了 20k 消息限制。

关键:Microsoft.Azure.SignalR.ServiceConnection[24] 服务返回握手错误:达到最大消息计数限制:20000。ID:535de32b-cedb-4cda-9959-675e6712f6ac

信息:Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport[11] WebSocket 被服务器关闭。关闭状态 NormalClosure。

dbug:Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[4] 处理 HttpConnection。

您可以创建一个新的免费层 Azure SignalR 服务并更改新的密钥或升级。在我们的开发过程中,我们只是在几乎完成之前创建了新的,并将其更改为标准层。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-01
    • 1970-01-01
    • 2020-08-17
    • 2017-08-01
    • 2021-07-20
    • 1970-01-01
    • 2021-10-22
    • 2020-08-24
    相关资源
    最近更新 更多