title: Area Route Problem in Netcore 3.1, invalid routing
body: <p>I have a problem with area</p>
  <p>in netcore 3.1, I add my endpoint on startup.cs,</p>
  <pre><code>        app.UseEndpoints(endpoints =&gt;
          {
              //   endpoints.MapControllers();
  
              //endpoints.MapControllerRoute(
              //      name: &quot;default&quot;,
              //      pattern: &quot;{controller}/{action=Index}/{id?}&quot;);
  
              endpoints.MapControllerRoute(
                  name: &quot;default&quot;,
                  pattern: &quot;{controller=Home}/{action=Index}/{id?}&quot;);
  
              endpoints.MapControllerRoute(
                 name: &quot;default&quot;,
                 pattern: &quot;{area:exists}/{controller=Home}/{action=Index}/{id?}&quot;);
  
              endpoints.MapRazorPages();
          });
  </code></pre>
  <p>add the service</p>
  <pre><code>    services.AddControllersWithViews();//.AddNewtonsoftJson(); ;
          services.AddRazorPages();
  </code></pre>
  <p>but it's routing on this way, what obviously doesn't work</p>
  <pre><code> controller/action?area=area
  </code></pre>
  <p>Example</p>
  <pre><code> Patients/Create?area=Medical
  </code></pre>
  <p>This is the way than I call it (by legacy purpose)</p>
  <pre><code>    &lt;a class=&quot;btn btn-primary&quot; href=&quot;@Url.Action(&quot;Create&quot;, &quot;Patients&quot;, new { area = &quot;Medicals&quot; })&quot;&gt;
  New Patient&lt;/a&gt;
  </code></pre>
  <p>I try in the classic way for netcore and trowme the same route</p>
  <pre><code>    &lt;a class=&quot;btn btn-primary&quot; asp-action=&quot;Create&quot; asp-controller=&quot;Patients&quot; asp-area=&quot;Medicals&quot;&gt;
  New Patient&lt;/a&gt;
  </code></pre>
  <p>I have the Package <strong>Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 3.1.9</strong> Installed, than use to be the main problem with razor</p>