views:

231

answers:

5

I spent countless hours trying to get Elmah working with asp.net mvc, but can't get it working 100%. Right now all the logging works fine, but the HttpHandlers are all screwy. Everytime I try and log into an admin account I automatically get redirected to Elmahs listings page.

It makes no sense because the path for elmah is just elmah.axd (that's what I use for the httphandler in the web.config) and my admin path is something like /MyAdmin/login, so I don't see the connection. I have also setup the ignore routes thing in my routes table for elmah. \

To sum it up.

Elmah logging works and so does the error display pages. When I try and log in to my admin account it automatically redirect to Elmahs error display page. I have no idea why.

  • If I comment out

routes.IgnoreRoute("elmah.axd");

my login works. IF I leave it in there it always redirects to elmah.

A: 

Watch the traffic on FIDDLER. It should give you some clues as to what's going on.

Esteban Araya
I use Live Http Headers not sure if it's much different. When I clicked on my form button it just loads up elmah, it doesn't even show a redirect.
chobo
+1  A: 

Google did a whole walk-through...

match your settings to theirs...

I didn't understand elmah and was able to do it.

http://code.google.com/p/elmah/wiki/MVC


-Mark

Hurricanepkt
Thanks, but I went through this several times and no luck
chobo
whats the route for the admin section?
Hurricanepkt
A: 

Guessing a bit, but can you try to use the Route Debugger to see if there is a problem hitting the correct route?

Also, is the IgnoreRoute call BEFORE all MapRoute calls?

Michael Stum
yes, all my ignoreRoutes are at the top of the list.
chobo
A: 

I think this is the updated version for setting it up, the one Hurricane pointed to was for earlier versions: http://code.google.com/p/elmah/wiki/DotNetSlackersArticle

rball
+2  A: 

I finally figured it out. No one would have got this one... I had a reference to RouteDebugger.dll which I got from the book "Asp.net MVC Framework Unleashed" and for some reason this dll messed up all my post requests if Elmah was enabled.

It was pure dumb luck that I figured it out. I couldn't get the RouteDebugger working so I deleted the reference and added a different one and then everything worked.

chobo