title: Microsoft.AspNetCore.Routing.RouteCreationException: 'An error occurred while creating the route with name 'default' and template
body: <p>I am a newbie to the Asp.Net core, and I am just creating a new Asp.Net Core 2 application, but getting as error as preceding. </p>
  
  <blockquote>
    <p>Microsoft.AspNetCore.Routing.RouteCreationException: 'An error occurred while creating the route with name 'default' and template '{controller=Home}/{action=Index}/{id=?}'.'</p>
  </blockquote>
  
  <p>Below is my <code>Configure</code> function code.</p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
  
              app.UseMvc(routes =&gt;
              {
                  routes.MapRoute(
                      name: "default",
                      template: "{controller=Home}/{action=Index}/{id?}"
                      );
              });
  
              app.Run(async (context) =&gt;
              {
                  await context.Response.WriteAsync("Hello World!");
              });
          }
  </code></pre>
  
  <p>The screenshot of the error is given below. </p>
  
  <p><a href="https://i.stack.imgur.com/div3q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/div3q.png" alt="enter image description here"></a></p>
  
  <p>Can anyone please help me resolve this issue?</p>