Azure / azure-signalr

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

Getting "Azure SignalR Service is not connected yet, please try again later." when upgrading Microsoft.AspNetCore.Http.Connections.Client to 6.0.0.0 #1503

Open chrfin opened 2 years ago

chrfin commented 2 years ago

Describe the bug

I have a classic ASP.NET MVC project targeting .NET 4.7.1 using SignalR and Microsoft.Azure.SignalR.AspNet. If I upgrade Microsoft.AspNetCore.Http.Connections.Client from 5.0.12.0 to 6.0.0.0 I get the following error with status code 500 when the client calls /negotiate:

Azure SignalR Service is not connected yet, please try again later.

To Reproduce

Create a classic ASP.NET MVC project and use the packages mentioned above.

Exceptions (if any)

I do not get any exceptions, just the mentioned 500 during negotiation.

Further technical details

I'm using 1.13.0 of the Microsoft.Azure.SignalR.AspNet package and when I enable logging like described HERE I get the following log entry:

Microsoft.Azure.SignalR Error: 0 : [Microsoft.Azure.SignalR.AspNet.ServiceConnection]Failed to connect to '(Primary)https://MY-SERVICE.service.signalr.net', will retry after the back off period. Error detail: Method 'get_Features' in type 'Microsoft.Azure.SignalR.WebSocketConnectionContext' from assembly 'Microsoft.Azure.SignalR.Common, Version=1.13.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.. Method 'get_Features' in type 'Microsoft.Azure.SignalR.WebSocketConnectionContext' from assembly 'Microsoft.Azure.SignalR.Common, Version=1.13.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.. Id: a23d8224-6c1d-4ef7-bbe0-5f150a299275

I guess there was a property changed with v6 of the Microsoft.AspNetCore.Http.* classes. If you can't reproduce with the given information, please tell me and I will create a repro-repo 🤓.

vicancy commented 2 years ago

Looks causing by https://github.com/dotnet/aspnetcore/issues/32307 that in 6.0 ConnectionContext this IFeatureCollection Features is considered to be in assembly Microsoft.Extension.Features image

However WebSocketConnectionContext implements Features in assembly Microsoft.AspNetCore.Http.Features image

As a result, it believes get_features is not implemented.

Hi David @davidfowl, do you have insights on how to handle such breaking changes?

vicancy commented 2 years ago

There is an on-going effort to fix this issue as tracked in https://github.com/dotnet/aspnetcore/issues/38699

chrfin commented 2 years ago

Update, as I just hit the same error again trying to update some dependencies:

The following three packages are required to be kept below v6.*:
* Microsoft.AspNetCore.Connections.Abstractions
* Microsoft.AspNetCore.Http.Connections.Common
* Microsoft.AspNetCore.Http.Connections.Client

The newest v5.* as to date is 5.0.17 and does still work.

chrfin commented 7 months ago

@vicancy / @davidfowl Any update on this? v5.0.17 is now deprecated and v8.0.2 still does not work...

jaydgus commented 6 months ago

@vicancy / @davidfowl Any update on this? v5.0.17 is now deprecated and v8.0.2 still does not work...

Did you get the latest assemblies to work?

ionelr commented 3 months ago

@vicancy / @davidfowl Any update on this? v5.0.17 is now deprecated and v8.0.2 still does not work...

Did you get the latest assemblies to work?

I just tried with those 3 packages versions 8.0.2 and 8.0.5 (latest), they DO NOT work 5.0.17 (deprecated) works issue still present

jaydgus commented 1 month ago

The following three packages are required to be kept below v6.*:

  • Microsoft.AspNetCore.Connections.Abstractions
  • Microsoft.AspNetCore.Http.Connections.Common
  • Microsoft.AspNetCore.Http.Connections.Client

The newest v5.* as to date is 5.0.17 and does still work.

This is still an issue. I updated our nugets and it broke the client-side signalR negotiation. I had to roll these 3 back to 5.0.17 to get it to work.