本文介绍了Azure中的Blazor:组件记录列表无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将我们的blazor应用程序部署到天蓝色时,由于以下错误(五分之四)失败(从chrome开发工具复制):

When deploying our blazor app to azure, it fails four out of five times with this error (copied from chrome dev tools):

[2019-12-16T11:12:55.214Z] Information: Normalizing '_blazor' to 'https://example.com/_blazor'.
[2019-12-16T11:12:55.470Z] Information: WebSocket connected to wss://example-web-signalr-service.service.signalr.net/client/?hub=componenthub&asrs.op=%2F_blazor&negotiateVersion=1&asrs_request_id=...&id=...&access_token=...
[2019-12-16T11:12:55.548Z] Error: The list of component records is not valid.
    e.log @ blazor.server.js:15
    C @ blazor.server.js:8
    (anonymous) @ blazor.server.js:8
    (anonymous) @ blazor.server.js:1
    e.invokeClientMethod @ blazor.server.js:1
    e.processIncomingData @ blazor.server.js:1
    connection.onreceive @ blazor.server.js:1
    i.onmessage @ blazor.server.js:1
[2019-12-16T11:12:55.552Z] Information: Connection disconnected.
Uncaught (in promise) Error: Invocation canceled due to the underlying connection being closed.
    at e.connectionClosed (blazor.server.js:1)
    at e.connection.onclose (blazor.server.js:1)
    at e.stopConnection (blazor.server.js:1)
    at e.transport.onclose (blazor.server.js:1)
    at e.close (blazor.server.js:1)
    at e.stop (blazor.server.js:1)
    at e.<anonymous> (blazor.server.js:1)
    at blazor.server.js:1
    at Object.next (blazor.server.js:1)
    at a (blazor.server.js:1)

我们对此毫无意义.如此失败的原因可能是什么?为什么在我们的本地开发人员计算机上它不会失败?很难在Google中找到与此相关的任何信息.

We can't make any sense out of this. What might be the cause for blazor to fail like this? Why doesn't it fail on our local developer machines? It is hard to find anything about this in google.

请告诉我是否需要提供更多信息.我不确定哪些代码片段可能是有用的信息.

Please tell me if I need to provide more information. I am not sure which code snippets might be useful information.

推荐答案

尝试一下:

services.AddSignalR().AddAzureSignalR(options =>
{
    options.ServerStickyMode = Microsoft.Azure.SignalR.ServerStickyMode.Required;
});

这篇关于Azure中的Blazor:组件记录列表无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 17:03