title: .net Core - Default controller is not loading when Route attribute is used
body: <p>A new .net core web application project comes with the following route configuration:</p>
  
  <pre><code>    app.UseMvc(routes =&gt;
      {
          routes.MapRoute(
              name: "default",
              template: "{controller=Home}/{action=Index}/{id?}");
      });
  </code></pre>
  
  <p>If you replace this with <code>app.UseMvc()</code> and add appropriate <code>Route</code> attributes for both HomeController and its actions (Index, About, Contact, Error), it would still work. Since we're not specifying a default route, the default view (Home/Index) will not be rendered if you hit <a href="http://localhost:25137/" rel="noreferrer">http://localhost:25137/</a>. Hope that understanding is correct! </p>
  
  <p>Now, since I need the default view to be shown when the <a href="http://localhost:25137/" rel="noreferrer">http://localhost:25137/</a> is hit, I changed the routing code to <code>app.UseMvcWithDefaultRoute();</code> which by definition will do the equivalent to the initial snippet. Even then, it was not rendering the default view; but worked when used the complete URL(<a href="http://localhost:25137/home/index" rel="noreferrer">http://localhost:25137/home/index</a>). That means the routing still works but not the default one! </p>
  
  <p>Then I went back to the controller and removed all the <code>Route</code> attribute from the HomeController and its actions. Then the default routing worked with out any issues. </p>
  
  <p>Is that the expected behavior?
  What could be the reason behind this behavior?</p>