我正在尝试在 Application_Error 的全局级别进行自定义错误处理。
Exception ex = Server.GetLastError();
Server.ClearError();
AssortmentDefinitionLogManager.LogException(ex);
Context.RewritePath("/Error/Error");
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(Context);
但我得到这个错误
Error Message - The view '~/Views/Shared/Error' or its master was not found or no view engine supports the searched locations.
我也试过这个
var urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext);
var redirectUrl = urlHelper.Action("Error", "Error");
Response.Redirect(redirectUrl);