How to use UseExceptionHandler in the mvc startup without redirecting the user?
问题 I have a ASP.NET Core 2.1 MVC application, and I'm trying to return a separate html view when an exception occurs. The reason for this is that if there are errors, we don't want google to register the redirects to the error page for our SEO (I've omitted development settings to clear things up). Our startup contained this: app.UseExceptionHandler("/Error/500"); // this caused a redirect because some of our middleware. app.UseStatusCodePagesWithReExecute("/error/{0}"); But we want to prevent a