views:

1565

answers:

6

My ASP.NET MVC application is within a folder called Stuff within IIS 6.0 webroot folder. So I access my pages as http://localhost/Stuff/Posts. I had EMLAH working while I was using the in-built webserver of Visual Studio. Now when I access http://localhost/Stuff/elmah.axd, I get resource not found error. Can anyone point my mistake here! Here is config file entry,

<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/> //Handler
  <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
  <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
  <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/> //Module
A: 

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?

James S
Thanks guys, Actually, I had to add the entries in the new system.webserver section in the web.config file too.
theraneman
Worked for me too. Why don't you post this as the solution.
Martin
A: 

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

redsquare
+5  A: 

Working with IIS7 I found I needed both sections of the web.config populated (system.web AND system.webServer) - see http://stackoverflow.com/questions/933554/elmah-not-working-with-asp-net-site/1175023#1175023.

Perhaps this is related.

eyesnz
I had the same problem as described in the question and this worked for me. Thanks!
Marek
+1  A: 

Hello! 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!)

Hassan Tabbal
A: 

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.

Duane Urban
A: 

I have implemented ELMAH in my development environment and the only way I was able to make it work was by changeing the Managed Pipelin mode to "Integrated", changing it to classic does not work. If somebody is aware of making it work in classic mode without making code modification, please advise.

gurudev