[英]Elmah.axd with a Catch-all route
I have the following route configurations: 我有以下路由配置:
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 }
);
The "404" controller is being called when I navigate to Elmah.axd. 当我导航到Elmah.axd时,将调用“ 404”控制器。 Why?
为什么?
In your web.config do you have this allowRemoteAccess turned on? 在您的web.config中,您是否启用了allowRemoteAccess?
<elmah>
<security allowRemoteAccess="1" />
</elmah>
and this inside the section group 这在组中
<sectionGroup name="elmah">
<section name="security" requirePermission="false"
type="Elmah.SecuritySectionHandler, Elmah" />
also check that you have this handler defined 还要检查您是否已定义此处理程序
<add name="Elmah" verb="POST,GET,HEAD" path="elmah.axd"
preCondition="integratedMode" type="Elmah.ErrorLogPageFactory, Elmah" />
or this one depending on which version of IIS you are running 还是这取决于您正在运行的IIS版本
<add verb="POST,GET,HEAD" path="elmah.axd"
type="Elmah.ErrorLogPageFactory, Elmah" />
One more thing I would definitely try and I feel ashamed to say "Have you tried clearing your cache!" 我肯定会再尝试一件事,我很to愧地说“您是否尝试过清除缓存!” as this one has bitten me once whilst using chrome
因为这个在使用chrome时曾经咬过我一次
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.