Search code examples
nuget-packagesignalr.clientasp.net-core-signalr

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


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.


Solution

  • 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?)