In trying to get my application to produce 404 errors correctly, I have implemented a catch all route at the end of my route table, as shown below:
routes.M
If you're looking for ASP.NET Core catch all routes and searching Google for asp.net core catch all route brings you here:
asp.net core catch all route
ASP.net core MVC catch all route serve static file