Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WithUrl() not found in Core 3 client

My .NET SignalR client code not working any more in Core 3 (WPF):

string hubAddress = "https://localhost:44329/Hub";
HubConnection hub = new HubConnectionBuilder().WithUrl(hubAddress).Build(); // WithUrl not found

MS document said it is there

Anyone know how to fix this?

like image 282
David Tsui Avatar asked Nov 03 '19 03:11

David Tsui


2 Answers

Found a solution: make sure project referencing Microsoft.AspNetCore.SignalR.Client, but not Microsoft.AspNetCore.SignalR.Client.Core.

like image 135
Serzas Avatar answered Oct 25 '22 20:10

Serzas


Remove the dependency Microsoft.AspNetCore.SignalR.Client.Core from you app and then add

Using Package Manager Console

Install-Package Microsoft.AspNetCore.SignalR.Client -Version 6.0.0

Using .Net CLI

dotnet add package Microsoft.AspNetCore.SignalR.Client --version 6.0.0

It will fix your issue

like image 25
Aftab Ahmed Avatar answered Oct 25 '22 20:10

Aftab Ahmed