“Resource not found” error while accessing elmah.axd in ASP.NET MVC project

瘦欲@ 提交于 2019-11-29 03:54:21
eyesnz

Working with IIS7 I found I needed both sections of the web.config populated (system.web AND system.webServer) - see Elmah not working with asp.net site.

Perhaps this is related.

Have you added an ignore *.axd routes in global.asax?

For Elmah, we need to differentiate between two things: First the http modules doing all the work of error logging, emailing...etc. Second, the http handlers, displaying the error log page and other pages (rss...etc.)

I was having the same problem of 404 resource not found because I have a weird setup! on my development machine, (windows 7, iis 7 ) elmah was working like a charm because the application pool was working in the integrated pipeline mode. In the production machine, however, the application was using the managed pipeline and I tried all my best to make elmah work but it was all useless...

I then got the idea of displaying the UI (error log page, rss, error detail,...) using regular aspx pages. I downloaded the source code, made some changes (sorry Atif, I was forced to do this because I needed the quickest solution) and then in my application , I created a folder under which I created regular aspx pages which inherits from Elmah defined pages. The page only contains one line (ex: for the detail page: <%@ Page Language="C#" Inherits ="Elmah.ErrorDetailPage"%>)

Now, I was able to run Elmah regardless of IIS 6/7 and it is working like a charm.. and It saved me from a big headache of correctly configuring http handlers and troubleshooting its work! additionally, configuring security is much simpler!

I don't know if the community is interested in this solution (If so, I am ready to post my full changes).

Hope that this gives you an idea on how to solve the problem in an alternative way (and if you need the modified dll with complete instructions on how to use it, just tell me!)

Duane Urban

In the application pool settings in IIS set Managed Pipelin Mode to Classic if you don't want to change code or the web.config file. Your axd.s will then work as before.

Can you post the rest of your web.config?

Or, if you're comfortable enough, can you just ensure that the httpHandlers and httpModules (NOT handlers and modules) sections are filled in properly in the web.config?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!