I think I've found my problem, but not sure what to do about it.
In the application_start, I have an operation that is erroring (on purpose
for my testing procedures). In the Application_error event, I am trying to
set a session var equal to the error message. However, this causes the
application to die. I am assuming that since app_start errored, session
state is not ever being initialized as even doing the following in app_error
causes the app to die:
dim a as string
a=session.sessionid
(I have proved out the above by creating a clean web app that does nothing
else than throw an error in app_start and ties to retrieve sessionid in
app_error...it doesn't work, no session info exists).
Since there is no per-user info at this point in the app's life, I also
can't redirect, so it always goes to the page specified in the web.config
file. Any way around that, either?
So, I need a way to tell if sessions are active or have been initialized for
the application yet so I know if I can safely use them in my error handling
or if I need to do it some other way in those instances where the error
happens in app_start. Can anyone shed light on how that might be done?
--
********************************
Jon