Azure / azure-signalr

Azure SignalR Service SDK for .NET
https://aka.ms/signalr-service
MIT License
427 stars 101 forks source link

Issue with Blazor Server app using Microsoft.Azure.SignalR 1.26.0 #2020

Closed Satwant-Singh-Plaha closed 3 months ago

Satwant-Singh-Plaha commented 3 months ago

Describe the bug

We are using Blazor App(.net 6.0) with Azure SignalRService. After upgrading Microsoft.Azure.SignalR from 1.25.2 to 1.26.0. having connection issues. After connect client is loosing connection.

To Reproduce

I am able to reproduce it using a new Blazor server app (net6.0) with Microsoft.Azure.SignalR 1.26.0. with Azure SignalR setup

builder.Services.AddSignalR(o => { o.EnableDetailedErrors = true; }).AddAzureSignalR(o => { o.ApplicationName = "LocalTest"; o.Endpoints = new[] { new ServiceEndpoint(new Uri(AZURE_SIGNALR_URL), new DefaultAzureCredential()) }; });

On start it connects to SignalR good, after some time it starts disconnecting. Same setup is working if i use Microsoft.Azure.SignalR 1.25.2. I added full exception details below.

Exceptions (if any)

Exception thrown after first connection Error while processing messages from k3zYp4BAni-IUqudW3ZmugQ24nYQo02. System.FormatException: Type System.Object is not supported at Microsoft.AspNetCore.Components.Server.BlazorPack.BlazorPackHubProtocolWorker.DeserializeObject(MessagePackReader& reader, Type type, String field) at Microsoft.AspNetCore.SignalR.Protocol.MessagePackHubProtocolWorker.CreateCompletionMessage(MessagePackReader& reader, IInvocationBinder binder) at Microsoft.AspNetCore.SignalR.Protocol.MessagePackHubProtocolWorker.ParseMessage(MessagePackReader& reader, IInvocationBinder binder) at Microsoft.AspNetCore.SignalR.Protocol.MessagePackHubProtocolWorker.TryParseMessage(ReadOnlySequence1& input, IInvocationBinder binder, HubMessage& message) at Microsoft.AspNetCore.Components.Server.BlazorPack.BlazorPackHubProtocol.TryParseMessage(ReadOnlySequence1& input, IInvocationBinder binder, HubMessage& message) at Microsoft.Azure.SignalR.ServiceConnection.ProcessOutgoingMessagesAsync(ClientConnectionContext connection, IHubProtocol protocol, CancellationToken token)

Further technical details

Blazor project

net6.0 enable enable

I can share more details as needed, Thanks!