Ask questionsSignalR .NetCore 3.0-- HubConnectionBuilder' does not contain a definition for 'WithUrl'
A clear and concise description of what the bug is. Hi, I'm trying to create a HubConnection on a Console App, but getting an error with .WithUrl.
Receiving the following error:
HubConnectionBuilder' does not contain a definition for 'WithUrl' and no accessible extension method 'WithUrl' accepting a first argument of type 'HubConnectionBuilder' could be found
My code:
using Microsoft.AspNetCore.SignalR.Client;
class Program
{
public static async Task Main(string[] args)
{
var connection = new HubConnectionBuilder()
.WithUrl("https://localhost:44386/NotificationHub")
.Build();
await connection.StartAsync();
while (true)
{
try
{
await connection.StartAsync();
break;
}
catch
{
await Task.Delay(1000);
}
}
Console.WriteLine("Client One listening. Hit Ctrl-C to quit.");
Console.ReadLine();
}
}
}
Related questions