Link to home
Start Free TrialLog in
Avatar of raterus
raterusFlag for United States of America

asked on

Application_Error not firing

Ok this is really annoying me.

I'm emailing error's that occur on my site in Application_Error.  It's worked before, even in production.  I'm bugfixing it right now on my local PC and I can't for the life of me get anything in Application_Error to fire.  (Using VS.net to debug)  I've set breakpoints, VS.net goes right over them.  On the surface, my error handling is working correctly, it even redirects me to the error page, which I've configured in web.config.

I've done all the obvious I can think of, I don't think it is a coding problem, because it has worked before.  I'm not an idiot (usually), so I don't think I'm doing something stupid (I haven't done anything!).  Restarted IIS, then restarted my computer.  I've even tried to handle page_error, and get the same results (never called).

Any ideas?
--Michael
Avatar of nauman_ahmed
nauman_ahmed
Flag of United States of America image

Avatar of AerosSaga
AerosSaga

are you catching it elsewhere first raterus?
In your routines I mean
Avatar of raterus

ASKER

Not any of those, I found those (and others) when I tried to research this problem earlier.  It's not so much I'm not getting my email anymore, when I debug, it never hits the application error code (at least the breakpoint anyway)
Avatar of raterus

ASKER

nope.  Here is how I'm throwing my "test" eror

Throw New ApplicationException("Blah")

I've also caused a real error too:

Dim i as integer = 1
dim j as integer = 0
dim k as integer = i/j

Avatar of raterus

ASKER

Like I said, I didn't change anything, which makes me think this is more than just a coding error.
Avatar of raterus

ASKER

Ok, this was a weird one, but it is fixed.  You would think "Build Solution" and "Rebuild Solution" would actually rebuild all your code, but NO.  I had to go to one of my class libraries and say "Rebuild myClassLibrary"  It turns out when I threw my exception, another exception was being thrown on top of that.  Dumb VS.net!
It sounds like a bug in the IDE then.  Perhaps recreating the global.asax?
Avatar of raterus

ASKER

first person to link to this question wins!
hehe I figured;)
link from where raterus?
for an answer to a question you mean?
Avatar of raterus

ASKER

that does seem like a VS.net bug though, the class library project was actually added to my solution, I didn't just link to the .dll (naturally that wouldn't rebuild..)
ASKER CERTIFIED SOLUTION
Avatar of AerosSaga
AerosSaga

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of raterus

ASKER

yes, I can't accept your previous questions, that wouldn't be a correct answer.  So you have to link to my answer.
Avatar of raterus

ASKER

cool, that was exactly the problem/solution I needed Aeros!
lol ;)
Avatar of raterus

ASKER

I hope nobody gets confused one day with my recursive answer.
Well if so I'm sure you'll set em straight.