How to ignore routes in ASP.NET Core?
<p>Previously, one would add something like this to <code>Global.aspx.cs</code>, which is gone in .NET Core:</p>

<pre><code>  routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
</code></pre>

<p>Here's what I currently have in my <code>Startup.cs</code> (for .NET Core):</p>

<pre><code>  app.UseDefaultFiles();

  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>The problem is that in MVC (pre-Core) <code>routes</code> was a <code>RouteCollection</code> and in .NET Core it's a <code>Microsoft.AspNetCore.Routing.IRouteBuilder</code> so <code>IgnoreRoute</code> is not a valid method.</p>