question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SignalR .NetCore 3.0-- HubConnectionBuilder' does not contain a definition for 'WithUrl'

See original GitHub issue

Describe 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
BrennanConroycommented, Apr 29, 2019

What does your .csproj look like?

I’m guessing you referenced Microsoft.AspNetCore.SignalR.Client.Core instead of Microsoft.AspNetCore.SignalR.Client in your .csproj. Change the reference and you’ll see the WithUrl method.

0reactions
davehuttoncommented, Nov 15, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found