global.asax and going from 1.1 to 3.5 (and IIS7?)

M

MattB

I have an older application I'm upgrading from the 1.1 framework to the
3.5 framework. I've also introduced IIS7 into the mix, so some of this
may be a result of that as well, although IIRC the debugger is based on
IIS6, right?
Most of the conversion has gone smoothly enough, but there are some
issues with global.asax and how the rules surrounding it have changed
that have me confused.

I used to have logging and email alerts of unhandled errors go right
from the Application_Error event. But much of the stuff I wanted to log
was in the current session state and if I referred to that from this
event I'd get an exception("Not available in this context"). Same for
the Session_End event.

I've addressed the Application_Error issue by doing a Server.Transfer to
my custom error handler and deal with the error over there. Seems to
work most of the time but every now and then I get a Null reference
exception on the Server.Transfer("error.aspx?src=AE") line.

I know at least some of these exceptions come from the Session_End
event. I also used to do some cleanup there based on what is in the
current session. So I tried the same trick
(Server.Transfer("error.aspx?src=SE")but always get a Null reference
exception on that line.
Anyone know why?
How to other people work around this?

Thanks!
Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top