What causes Application_End?

P

Philipp Schumann

In one of my web developments, the Application_End event occurs several
times while a user browses the pages. Because I make use of extensive
session tracking and also provide a couple of services that need the session
state, that is highly problematic as the sessions are abandoned when the
application ends. I have observed this behaviour for quite a while now,
locally as well as on the web, so it must be due to some of my code.

Is there any documentation around what exactly causes the ASPX application
to be restarted, other than a server re-start? Has anyone experienced
similar problems, or otherwise any kind of clue that might help? I've had a
hint from someone, saying that "rather critical errors" could provoke such
behaviour. However, detailed information (as to what kind of error) would be
good as I have no idea what in my code that could be, nor when it started to
behave like it.

Additional info:

Read-Write-Access MDB database
Read-Write Access in a couple of directories
Temporary image files are generated on each request

Although this seems to be a code-related error, I can report that the
Application_Error event does not occur.

I'm looking forward to hearing your ideas.
Best,
Philipp Schumann
 
M

Mark Fitzpatrick

Sometimes a virus scanner will cause this as the application will be
restarted if it thinks that the web.config file has changed. You may also
want to make sure that the sessions aren't abandoning first because if all
the sessions are abandoned and no sessions are active any longer then the
application will call the End event to clean up until the next session is
launched. You might try dumping some info to the trace log from the
global.asax (using the HttpContext.Current.Trace object) as that might let
you see some timing of events going on that may appear odd, like the
Sessions ending prematurely, such as at the end of a page.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top