title: SignalR: Unable to connect to the server with any of the available transports
body: <p>I'm using Microsoft.AspNetCore.SignalR.Client (1.1.0v) in a WPF application targeting .Net 4.6.2. I'm setting up the client like:</p>
  
  <pre><code>public class SignalRClient
  {
     private readonly HubConnection hubConnection;
  
     public SignalRClient()
     {
        this.hubConnection = new HubConnectionBuilder()
                  .WithUrl("http://localhost:8089/MyDataHub")
                  .Build();
     }
  
     // I'm calling the following method through a callback function in Autofac container after the DI container is built (but I tried doing this directly in the ctor and I got the same issue).
  
     public void Initialize()
     {
        Task.Factory.StartNew(
             () =&gt; 
             {
                 // This is where I get the error.
                 this.hubConnection.StartAsync().Wait();
             })
     }
  }
  </code></pre>
  
  <p>Server side logs show:</p>
  
  <pre><code>16:56:45.380  Info | Request starting HTTP/1.1 GET http://localhost:8089/MyDataHub?id=7qLNfG-iV1Xr3oN_r8U_nA
  info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
        Request starting HTTP/1.1 POST http://localhost:8089/MyDataHub/negotiate  0
  16:56:45.540  Info | Request starting HTTP/1.1 POST http://localhost:8089/MyDataHub/negotiate  0
  info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
        Request finished in 11.2669ms 200 application/json
  16:56:45.552  Info | Request finished in 11.2669ms 200 application/json
  info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
        Request starting HTTP/1.1 POST http://localhost:8089/MyDataHub/negotiate  0
  16:56:45.703  Info | Request starting HTTP/1.1 POST http://localhost:8089/MyDataHub/negotiate  0
  info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
        Request finished in 7.7109ms 200 application/json
  16:56:45.703  Info | Request finished in 7.7109ms 200 application/json
  info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
        Request starting HTTP/1.1 GET http://localhost:8089/MyDataHub?id=4TN4k9wZWXsZ5iPyGNKSOA
  16:56:45.719  Info | Request starting HTTP/1.1 GET http://localhost:8089/MyDataHub?id=4TN4k9wZWXsZ5iPyGNKSOA
  info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
        Request finished in 6.7847ms 200 application/octet-stream
  16:56:45.719  Info | Request finished in 6.7847ms 200 application/octet-stream
  fail: Microsoft.AspNetCore.SignalR.HubConnectionContext[5]
        Failed connection handshake.
  16:56:51.013 Error | Failed connection handshake.
  info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
        Request finished in 20012.9772ms 101
  16:57:05.393  Info | Request finished in 20012.9772ms 101
  </code></pre>
  
  <p>Error message client-side:</p>
  
  <pre><code>Unable to connect to the server with any of the available transports
  </code></pre>
  
  <p>I can't quite understand what this error means and how to fix it. It looks like the server and the client can't agree on a transport?</p>
  
  <p>Note that the server is using Microsoft.AspNet.SignalR (2.4.0v). The server project is a Asp.Net Core 2.1 application (I can't change anything here). I'm trying to use the AspNet Core version for client (this seems possible because when I tested with some other .Net Framework WPF and Console projects targeting the exact same framework version, I did not get this error).</p>
  
  <ol>
  <li>What are the possible causes for this particular error?</li>
  <li>Possible fixes.</li>
  </ol>
  
  <p>EDIT:</p>
  
  <p>Route mapping in the server:</p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  {
     app.UseSignalR(routes =&gt; { routes.MapHub&lt;MyDataHub&gt;("/MyDataHub"); });
  }
  </code></pre>
  
  <p>EDIT 2:</p>
  
  <p>MyDataHub.cs class:</p>
  
  <pre><code>public class MyDataHub : Hub&lt;IMyDataHub&gt;
  {
     public async Task SendMessage(MyData data)
     {
        await this.Clients.All.SendMessage(data);
     }
  
     // Some other business methods here defined in `IMyDataHub` interface that are meant to be invoked by clients.
  }
  </code></pre>