[英]Elmah.axd with a Catch-all route
我有以下路由配置:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("elmah.axd");
routes.IgnoreRoute("favicon.ico");
routes.MapRoutes(); // Register Attribute Based Routes which the current assembly contains
routes.MapRoute(
"404",
"{*url}",
new { controller = MVC.Error.Name, action = "CatchAllUnmappedRoutes", id = UrlParameter.Optional }
);
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = MVC.Student.Name, action = "Index", id = UrlParameter.Optional }
);
當我導航到Elmah.axd時,將調用“ 404”控制器。 為什么?
在您的web.config中,您是否啟用了allowRemoteAccess?
<elmah>
<security allowRemoteAccess="1" />
</elmah>
這在組中
<sectionGroup name="elmah">
<section name="security" requirePermission="false"
type="Elmah.SecuritySectionHandler, Elmah" />
還要檢查您是否已定義此處理程序
<add name="Elmah" verb="POST,GET,HEAD" path="elmah.axd"
preCondition="integratedMode" type="Elmah.ErrorLogPageFactory, Elmah" />
還是這取決於您正在運行的IIS版本
<add verb="POST,GET,HEAD" path="elmah.axd"
type="Elmah.ErrorLogPageFactory, Elmah" />
我肯定會再嘗試一件事,我很to愧地說“您是否嘗試過清除緩存!” 因為這個在使用chrome時曾經咬過我一次
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.