what is difference between microsoft.aspnetcore.signalr.client and microsoft.aspnetcore.signalr.client.core?
Asked Answered
D

2

7

There are two nuget packages for SignalR client:

Microsoft.AspNetCore.SignalR.Client and Microsoft.AspNetCore.SignalR.Client.Core.

Both ASP.NET Core, but I can't find any information why they both exist.

Probably Client.Core has limited functionality, but this is just my guess.

Dispensation answered 29/5, 2020 at 1:45 Comment(0)
G
6

Both ASP.NET Core, but I can't find any information why they both exist.

The Microsoft.AspNetCore.SignalR.Client package depends upon the Microsoft.AspNetCore.SignalR.Client.Core package.

enter image description here

And from doc of "ASP.NET Core SignalR .NET Client", we can find that:

The Microsoft.AspNetCore.SignalR.Client package is required for .NET clients to connect to SignalR hubs.

Besides, if you do a test with only installing the Microsoft.AspNetCore.SignalR.Client.Core package in your client app, you would find you can not call WithUrl method to configure the HubConnection to use HTTP-based transports to connect to the specified URL.

And it would cause the error, like below.

'HubConnectionBuilder' does not contain a definition for 'WithUrl' and no accessible extension method 'WithUrl' accepting a first argument of type 'HubConnectionBuilder' could be found (are you missing a using directive or an assembly reference?)

Greatest answered 29/5, 2020 at 6:8 Comment(0)
O
0

As of .Net 8.0 when you install Microsoft.AspNetCore.SignalR.Client the Microsoft.AspNetCore.SignalR.Client.Core will be installed as well. Microsoft.AspNetCore.SignalR.Client.Core should be just a subset which does not have some extended methods like WithURL.

Obannon answered 28/1 at 19:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.