我已经设置好了,我可以浏览到/elmah.axd 但我一直在导致所有这些错误,它不会记录任何错误,它只是说“没有记录错误”......我到底做了什么错误的?
这是我添加到 web.config 的内容:
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
</sectionGroup>
</configSections>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
</httpModules>
<elmah>
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
<security allowRemoteAccess="yes" />
</elmah>
另外:这已经在我的 RegisterRoutes() 开始时了
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
我读到它与 ASP.NET MVC 1.0 无关,据说(根据 ELMAH 网站...)
最佳答案
配置似乎是有序的;我最好的猜测是您的 IIS Web 应用程序用户没有写入 App_Data 的权限。如果您锁定了权限,应用程序用户将在那里拥有读取权限,但没有写入权限。
您可以打开权限或登录到 Web 路径之外的另一个目录(IMO 更安全一点),并确保在那里设置用户的读/写权限。
关于asp.net-mvc - ELMAH.axd 是可浏览的,但永远不会记录我的任何错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2016021/