title: Error:- method not found while connecting signalr
body: <p>having error with signalr. On running application it is showing error "method not found".
  having problem in connection.</p>
  
  <p>I'm using signalr for chatting purpose. The project is in Reactjs and asp.net core.
  react app is created through creat-react-app (console).</p>
  
  <p>// code in reactjs*****</p>
  
  <pre><code>import React, { Component } from 'react';
  import { HubConnection } from 'signalr-client-react';
  
  class SingnalR extends Component {
      constructor(props) {
          super(props);
          this.state = {
                  bookingMessage: '',
                  bookingHubConnection: null
              };
      }
  
      componentDidMount() {
          const bookingHubConnection = new HubConnection('http://localhost:5000/chatHub')
          this.setState({ bookingHubConnection }, () =&gt; {
              this.state.bookingHubConnection.start()
                  .then(() =&gt; console.log('Signalr started '))
                  .catch((err) =&gt; console.log('Error connecting signalr - ' + err));
  
  
          this.state.bookingHubConnection.on('booking', (message) =&gt; {
              const bookingMessage = message;
              this.setState({ bookingMessage });
          });
  
      });
  
  
      }
  
      render() {
          return (
              &lt;div&gt;
                  &lt;div&gt;message from server {this.state.bookingMessage}&lt;/div&gt;
                  userName &lt;input id="userName" /&gt;
                  userMessage&lt;input id="userMessage" /&gt;
                  &lt;button id = "sendMessage"&gt; sendMessage&lt;/button&gt;
              &lt;/div&gt;
          )
      }
  }
  
  export default SingnalR;
  </code></pre>
  
  <p>//code for asp.net core*******</p>
  
  <p>//code chatHub</p>
  
  <pre><code>using Microsoft.AspNetCore.SignalR;
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  
  namespace TinyHouseApi.SignalR
  {
      public class ChatHub:Hub
      {
          public async Task SendMessage(string user, string message)
          {
              await Clients.All.SendAsync("ReceiveMesage", user, message);
          }
      }
  }
  
  //code of Startupfile
   public class Startup
      {
          public Startup(IConfiguration configuration)
          {
              Configuration = configuration;
          }
  
          public IConfiguration Configuration { get; }
  
          // This method gets called by the runtime. Use this method to add services to the container.
          public void ConfigureServices(IServiceCollection services)
          {
              services.AddCors();
              services.AddDbContext&lt;DataContext&gt;(options =&gt; options.UseSqlServer(Configuration.GetConnectionString("testDB")));
              services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
              services.AddAutoMapper();
  
              //configure SignalR
              services.AddSignalR();
  
              // configure strongly typed settings objects
              var appSettingsSection = Configuration.GetSection("AppSettings");
              services.Configure&lt;AppSettings&gt;(appSettingsSection);
  
  
   public void Configure(IApplicationBuilder app, IHostingEnvironment env)
          {
              // global cors policy
              app.UseCors(x =&gt; x
                  .AllowAnyOrigin()
                  .AllowAnyMethod()
                  .AllowAnyHeader());
  
              app.UseAuthentication();
  
              app.UseMvc();
  
              //SignalR
              app.UseSignalR(routes =&gt;
              {
                  routes.MapHub&lt;ChatHub&gt;("/chatHub");
              });
          }
          }
  </code></pre>