title: Change Global Settings Config in SignalR Core
body: <p>I am using <a href="https://www.nuget.org/packages/Microsoft.AspNet.SignalR.Core/" rel="nofollow"><strong>SignalR Core</strong></a> with <strong><a href="http://www.asp.net/core" rel="nofollow">ASP.Net Core</a></strong>.</p>
  
  <p>I want to override <strong>GlobalHost</strong> settings for signalR.</p>
  
  <p>I am getting <strong><a href="http://www.asp.net/signalr/overview/guide-to-the-api/handling-connection-lifetime-events#changetimeout" rel="nofollow">this</a></strong>-</p>
  
  <pre><code>protected void Application_Start(object sender, EventArgs e)
  {
      // Make long polling connections wait a maximum of 110 seconds for a
      // response. When that time expires, trigger a timeout command and
      // make the client reconnect.
      GlobalHost.Configuration.ConnectionTimeout = TimeSpan.FromSeconds(110);
  
      // Wait a maximum of 30 seconds after a transport connection is lost
      // before raising the Disconnected event to terminate the SignalR connection.
      GlobalHost.Configuration.DisconnectTimeout = TimeSpan.FromSeconds(30);
  
      // For transports other than long polling, send a keepalive packet every
      // 10 seconds. 
      // This value must be no more than 1/3 of the DisconnectTimeout value.
      GlobalHost.Configuration.KeepAlive = TimeSpan.FromSeconds(10);
  
      RouteTable.Routes.MapHubs();
  }
  </code></pre>
  
  <p>But <strong>I can't configure it with my application</strong>.</p>
  
  <p>It is on ASP.Net Core v1.0.</p>
  
  <p>My <strong>Startup.cs</strong> is like this-</p>
  
  <pre><code>using Microsoft.AspNetCore.Builder;
  using Microsoft.AspNetCore.Cors.Infrastructure;
  using Microsoft.AspNetCore.Hosting;
  using Microsoft.EntityFrameworkCore;
  using Microsoft.Extensions.Configuration;
  using Microsoft.Extensions.DependencyInjection;
  using Microsoft.Extensions.Logging;
  
  namespace McpSmyrilLine
  {
      public class Startup
      {
          public Startup(IHostingEnvironment env)
          {
              var builder = new ConfigurationBuilder()
                  .SetBasePath(env.ContentRootPath)
                  .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                  .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                  .AddEnvironmentVariables();
  
              if (env.IsDevelopment())
              {
                  // This will push telemetry data through Application Insights pipeline faster, allowing you to view results immediately.
                  builder.AddApplicationInsightsSettings(developerMode: true);
              }
              Configuration = builder.Build();
  
          }
  
          public IConfigurationRoot Configuration { get; }
  
          // This method gets called by the runtime. Use this method to add services to the container.
          public void ConfigureServices(IServiceCollection services)
          {
              // Add framework services.
              services.AddApplicationInsightsTelemetry(Configuration);
              //Add DB Context
              var connectionStringBuilder = new Microsoft.Data.Sqlite.SqliteConnectionStringBuilder { DataSource = "mcp.db" };
              var connectionString = connectionStringBuilder.ToString();
  
              ///////////////Add Cors
              var corsBuilder = new CorsPolicyBuilder();
              corsBuilder.AllowAnyHeader();
              corsBuilder.AllowAnyMethod();
              corsBuilder.AllowAnyOrigin();
              corsBuilder.AllowCredentials();
  
              services.AddCors(options =&gt;
              {
                  options.AddPolicy("AllowAll", corsBuilder.Build());
              });
              ///////////////End Cors
  
              services.AddDbContext&lt;McpDbContext&gt;(options =&gt;
                  options.UseSqlite(connectionString));
  
              services.AddMvc();
              services.AddSignalR(options =&gt; { options.Hubs.EnableDetailedErrors = true; });
          }
  
          // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
          public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
          {
              loggerFactory.AddConsole(Configuration.GetSection("Logging"));
              loggerFactory.AddDebug();
  
              //Configure Cors
              app.UseCors("AllowAll");
  
              app.UseSignalR();
  
              app.UseApplicationInsightsRequestTelemetry();
  
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
                  app.UseBrowserLink();
                  //Adding Seeder Data
                  AddTestData(app.ApplicationServices.GetService&lt;McpDbContext&gt;());
              }
              else
              {
                  app.UseExceptionHandler("/Home/Error");
              }
  
              app.UseApplicationInsightsExceptionTelemetry();
  
              app.UseStaticFiles();
  
              app.UseMvc(routes =&gt;
              {
                  routes.MapRoute(
                      name: "default",
                      template: "{controller=Home}/{action=Index}/{id?}");
              });
          }
  
          private static void AddTestData(McpDbContext context)
          {
              //var testUser1 = new DbModels.Try.User
              //{
              //    Id = "abc123",
              //    FirstName = "Luke",
              //    LastName = "Skywalker"
              //};
  
              //context.Users.Add(testUser1);
  
              //var testPost1 = new DbModels.Try.Post
              //{
              //    Id = "def234",
              //    UserId = testUser1.Id,
              //    Content = "What a piece of junk!"
              //};
  
              //context.Posts.Add(testPost1);
  
              //context.SaveChanges();
          }
      }
  }
  </code></pre>
  
  <p>Can anyone please help?</p>