These instructions do not work for .NET Core 3.0. There is no more app.useMVC. Please instruct how to do this with endpoints and/or AddControllersWithViews. Thank you.
@Rick-Anderson edit: 10K PV
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
+1 today core 3.1 is out
This is how I'm doing it in core 3.1:
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "areaRoute",
pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
endpoints.MapRazorPages();
});
Thanks @DrewBrasher
I got caught up trying to use MapAreaControllerRoute instead of just MapControllerRoute.
Most helpful comment
This is how I'm doing it in core 3.1: