title: SignalR no transport
body: <p>Attempting to start signal-r hub reports "Error: No available transports found."</p>
  
  <p>However, a diagnostic capture shows that negotiation returns <em>three</em> available transports. </p>
  
  <pre><code>{
      "connectionId": "IsHpe_1ETRLz-flnJ3uKPg",
      "availableTransports": [
          {
              "transport": "WebSockets",
              "transferFormats": [
                  "Text",
                  "Binary"
              ]
          },
          {
              "transport": "ServerSentEvents",
              "transferFormats": [
                  "Text"
              ]
          },
          {
              "transport": "LongPolling",
              "transferFormats": [
                  "Text",
                  "Binary"
              ]
          }
      ]
  }
  </code></pre>
  
  <p>This is done with aspnetcore 2.1 preview2 and startup looks like this </p>
  
  <pre><code>    public void ConfigureServices(IServiceCollection services)
      {
          services.AddCors(options =&gt; options.AddPolicy("AllowAny", x =&gt;
            x.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin()));
          services.AddSignalR();
          services.AddOptions();
          services.Configure&lt;AppSettings&gt;(Configuration);
          var connectionStrings = Configuration.GetSection("ConnectionStrings");
          var defaultConnectionString = connectionStrings[Configuration["DefaultConnectionString"]];
          services.AddDbContext&lt;au1.Model.ProwlerDbContext&gt;(options =&gt; 
            options.UseSqlServer(defaultConnectionString));
          services.AddMvc();
      }
  
      // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
      public void Configure(IApplicationBuilder app, IHostingEnvironment env)
      {
          app.UseCors("AllowAny");
          app.UseSignalR(routes =&gt;
          {
              routes.MapHub&lt;MessageHub&gt;("/message");
          });
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
              app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
              {
                  HotModuleReplacement = true
              });
          }
          else
          {
              app.UseExceptionHandler("/Home/Error");
          }
  
          app.UseStaticFiles();
  
          app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: "default",
                  template: "{controller=Home}/{action=Index}/{id?}");
  
              routes.MapSpaFallbackRoute(
                  name: "spa-fallback",
                  defaults: new { controller = "Home", action = "Index" });
          });
      }
  </code></pre>
  
  <p>Obviously the route works, or negotiation wouldn't appear in the network traffic. Invoking <a href="http://local:5000/message" rel="nofollow noreferrer">http://local:5000/message</a> with a browser produces a message <code>Connection ID required</code> as expected.</p>
  
  <p>Have I left a step out? </p>
  
  <p>On the client side, here's how I've tried to connect.</p>
  
  <pre><code>    this.signalr = new SignalR.HubConnection("http://localhost:5000/message");
      this.signalr.on("stateChange", (data: string) =&gt; {
          console.log(`SignalR: ${data}`);
          that.selection = data;
      });
      this.signalr.start().then(result=&gt;{
          console.log("hub started");
      }).catch(err=&gt;{
          console.log("hub failed to start");
      });
  </code></pre>
  
  <p>package.json says <code>"_id": "@aspnet/signalr@1.0.0-preview1-update1",</code></p>
  
  <p>The .csproj says  <code>&lt;PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.0.0-preview2-final" /&gt;</code></p>
  
  <p>These are not the same. Whether they are compatible I could not say.</p>
  
  <p>I don't know how these got out of synch as I omitted version to get the latest of each. An npm update brought the client to preview2 and I shall now retest.</p>