SignalR .NetCore 3.0-- HubConnectionBuilder' does not contain a definition for 'WithUrl'
See original GitHub issueDescribe the bug
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();
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
WithUrl() not found in Core 3 client
Found a solution: make sure project referencing Microsoft.AspNetCore.SignalR.Client, but not Microsoft.AspNetCore.SignalR.Client.Core.
Read more >HubConnectionBuilderHttpExten...
Configures the HubConnection to use HTTP-based transports to connect to the specified URL and transports. WithUrl(IHubConnectionBuilder, String). Configures the ...
Read more >Differences between SignalR and ASP.NET Core SignalR
NET Core SignalR isn't compatible with clients or servers for ASP. ... ASP.NET Core SignalR doesn't have support for HubPipeline modules.
Read more >Resolved: SignalR Error: Failed To Complete Negotiation ...
This blog provides a solution to the signalR hub connection issue such as Error: Failed to complete negotiation with the server: Error: Not...
Read more >Build Real-time Applications with ASP.NET Core SignalR
In this article, you'll learn about the origins of SignalR and how it has been rewritten to run on ASP.NET Core and address...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

What does your .csproj look like?I’m guessing you referenced
Microsoft.AspNetCore.SignalR.Client.Coreinstead ofMicrosoft.AspNetCore.SignalR.Clientin your .csproj. Change the reference and you’ll see theWithUrlmethod.I got confused by which version I needed to install. Not sure if that would catch anyone else http://assets.gocreative1.net/wp-content/uploads/sites/38/2019/11/signalrVersionConfused.jpg