Application_End event handler not getting called on development

Application_End event handler not getting called on development

am 11.01.2008 00:35:59 von Tenacious

I am trying to shutdown a database server in the Application_End event
handler on the Global.asax page. So far I am trying this only on the
development server that comes with Visual Studio 2005. When I close
the browser, this does not cause the Application_End event to trigger.
It also will not occur when I shut down the development server. At
this point the application is no longer running, so why didn't the
event handler ever get called?

Any suggestions or guesses will be appreciated.
Thanks

Re: Application_End event handler not getting called on development server

am 11.01.2008 00:56:48 von nomailreplies

re:
!> When I close the browser, this does not cause the Application_End event to trigger

Closing the browser isn't supposed to trigger Application_End.

re:
!> It also will not occur when I shut down the development server

The development server doesn't handle Application_End.
There would be no purpose to doing that because there's no Application Domain to restart.

Test Application_End on IIS.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Tenacious" wrote in message
news:dd3b4ff9-3b01-4c2b-8f8c-86b93949bfc8@f47g2000hsd.google groups.com...
>I am trying to shutdown a database server in the Application_End event
> handler on the Global.asax page. So far I am trying this only on the
> development server that comes with Visual Studio 2005. When I close
> the browser, this does not cause the Application_End event to trigger.
> It also will not occur when I shut down the development server. At
> this point the application is no longer running, so why didn't the
> event handler ever get called?
>
> Any suggestions or guesses will be appreciated.
> Thanks

Re: Application_End event handler not getting called on development

am 11.01.2008 01:15:23 von Tenacious

On Jan 10, 3:56=A0pm, "Juan T. Llibre"
wrote:
> re:
> !> When I close the browser, this does not cause the Application_End event=
to trigger
>
> Closing the browser isn't supposed to trigger Application_End.
>
> re:
> !> It also will not occur when I shut down the development server
>
> The development server doesn't handle Application_End.
> There would be no purpose to doing that because there's no Application Dom=
ain to restart.
>
> Test Application_End on IIS.
>
> Juan T. Llibre, asp.net MVP
> asp.net faq :http://asp.net.do/faq/
> foros de asp.net, en espa=F1ol :http://asp.net.do/foros/
> ==================== =====
=============="Tenacious" =
wrote in message
>
> news:dd3b4ff9-3b01-4c2b-8f8c-86b93949bfc8@f47g2000hsd.google groups.com...
>
>
>
> >I am trying to shutdown a database server in the Application_End event
> > handler on the Global.asax page. So far I am trying this only on the
> > development server that comes with Visual Studio 2005. When I close
> > the browser, this does not cause the Application_End event to trigger.
> > It also will not occur when I shut down the development server. At
> > this point the application is no longer running, so why didn't the
> > event handler ever get called?
>
> > Any suggestions or guesses will be appreciated.
> > Thanks- Hide quoted text -
>
> - Show quoted text -

Thanks for taking the time to answer my question. This is my first web
app that I'm doing for my company. One thing that I don't understand
about the web application life cycle is what will ever cause the
application to end when no more requests are coming in? Will it just
continue to remain in memory until the server is shut down? I'm
thinking that there probably is a time out setting somewhere, but I
don't know where it would be at this point.

Re: Application_End event handler not getting called on development server

am 11.01.2008 09:59:28 von Patrice

It depends how the application pool is configured. You could leave it
forever or it could shutdown after a given timeout after the last request...

You may want to be a more specific about what you are trying to do (you
really "shutdown" the database server ???)

---
Patrice

"Tenacious" a écrit dans le message de news:
c28d29ab-a667-46af-b1d2-0737219cc943@l6g2000prm.googlegroups .com...
On Jan 10, 3:56 pm, "Juan T. Llibre"
wrote:
> re:
> !> When I close the browser, this does not cause the Application_End event
> to trigger
>
> Closing the browser isn't supposed to trigger Application_End.
>
> re:
> !> It also will not occur when I shut down the development server
>
> The development server doesn't handle Application_End.
> There would be no purpose to doing that because there's no Application
> Domain to restart.
>
> Test Application_End on IIS.
>
> Juan T. Llibre, asp.net MVP
> asp.net faq :http://asp.net.do/faq/
> foros de asp.net, en español :http://asp.net.do/foros/
> ======================================"Tenacious"
> wrote in message
>
> news:dd3b4ff9-3b01-4c2b-8f8c-86b93949bfc8@f47g2000hsd.google groups.com...
>
>
>
> >I am trying to shutdown a database server in the Application_End event
> > handler on the Global.asax page. So far I am trying this only on the
> > development server that comes with Visual Studio 2005. When I close
> > the browser, this does not cause the Application_End event to trigger.
> > It also will not occur when I shut down the development server. At
> > this point the application is no longer running, so why didn't the
> > event handler ever get called?
>
> > Any suggestions or guesses will be appreciated.
> > Thanks- Hide quoted text -
>
> - Show quoted text -

Thanks for taking the time to answer my question. This is my first web
app that I'm doing for my company. One thing that I don't understand
about the web application life cycle is what will ever cause the
application to end when no more requests are coming in? Will it just
continue to remain in memory until the server is shut down? I'm
thinking that there probably is a time out setting somewhere, but I
don't know where it would be at this point.

Re: Application_End event handler not getting called on development server

am 11.01.2008 14:38:06 von nomailreplies

re:
!> Thanks for taking the time to answer my question.

No prob. I love helping others, like I was helped by many.

re:
!> One thing that I don't understand about the web application life cycle is what
!> will ever cause the application to end when no more requests are coming in?

You can configure IIS 6.0 and 7.0 to recycle the application pool the application lives in.

You can recycle the worker processes by :

....in the "Recycling tab
1. the number of minutes which have gone by since the application was started.
2. the total number of requests which have been made
3. a particular time of day which you define
4. the maximum amount of memory which you want the application to use
( For both physical and virtual memory. You can set different thresholds for each )

or...in the "Performance" tab
5. you can shutdown the worker process when the process has been idle for a soecified number of minutes

You set these parameters in the IIS Manager.
Scroll on the left to the "Application Pools" section, right click any Application Pool and select "Properties".

Experiment with the settings but don't set the thresholds too high, as that may affect performance.

For example: total memory consumption shouldn't be higher than 60% of your installed RAM.
I use 40% ( with 2GB RAM installed, so IIS will recycle the pools when they reach 800MB RAM used ).

That has never happened. At most, they have gotten to about 200MB.

I do recycle on other parameters, though.
You can set several options so if one doesn't occur another one will.

It's important to recycle your application pools before their excessive RAM usage clogs up your server.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Tenacious" wrote in message
news:c28d29ab-a667-46af-b1d2-0737219cc943@l6g2000prm.googleg roups.com...
On Jan 10, 3:56 pm, "Juan T. Llibre"
wrote:
> re:
> !> When I close the browser, this does not cause the Application_End event to trigger
>
> Closing the browser isn't supposed to trigger Application_End.
>
> re:
> !> It also will not occur when I shut down the development server
>
> The development server doesn't handle Application_End.
> There would be no purpose to doing that because there's no Application Domain to restart.
>
> Test Application_End on IIS.
>
> Juan T. Llibre, asp.net MVP
> asp.net faq :http://asp.net.do/faq/
> foros de asp.net, en español :http://asp.net.do/foros/
> ======================================"Tenacious" wrote in message
>
> news:dd3b4ff9-3b01-4c2b-8f8c-86b93949bfc8@f47g2000hsd.google groups.com...
>
>
>
> >I am trying to shutdown a database server in the Application_End event
> > handler on the Global.asax page. So far I am trying this only on the
> > development server that comes with Visual Studio 2005. When I close
> > the browser, this does not cause the Application_End event to trigger.
> > It also will not occur when I shut down the development server. At
> > this point the application is no longer running, so why didn't the
> > event handler ever get called?
>
> > Any suggestions or guesses will be appreciated.
> > Thanks- Hide quoted text -
>
> - Show quoted text -

Thanks for taking the time to answer my question. This is my first web
app that I'm doing for my company. One thing that I don't understand
about the web application life cycle is what will ever cause the
application to end when no more requests are coming in? Will it just
continue to remain in memory until the server is shut down? I'm
thinking that there probably is a time out setting somewhere, but I
don't know where it would be at this point.

Re: Application_End event handler not getting called on developmen

am 11.01.2008 17:48:10 von brucebarker

you also need to be careful of what you put in application end events.
shutting down another service may cause problems.

if asp.net performs a recycle (code/config change, too much memory,etc), a
new appdomaiin is started and the old one shutdown. its application_start may
fire before the old appdomain application_end fires.

-- bruce (sqlwork.com)


"Tenacious" wrote:

> On Jan 10, 3:56 pm, "Juan T. Llibre"
> wrote:
> > re:
> > !> When I close the browser, this does not cause the Application_End event to trigger
> >
> > Closing the browser isn't supposed to trigger Application_End.
> >
> > re:
> > !> It also will not occur when I shut down the development server
> >
> > The development server doesn't handle Application_End.
> > There would be no purpose to doing that because there's no Application Domain to restart.
> >
> > Test Application_End on IIS.
> >
> > Juan T. Llibre, asp.net MVP
> > asp.net faq :http://asp.net.do/faq/
> > foros de asp.net, en español :http://asp.net.do/foros/
> > ======================================"Tenacious" wrote in message
> >
> > news:dd3b4ff9-3b01-4c2b-8f8c-86b93949bfc8@f47g2000hsd.google groups.com...
> >
> >
> >
> > >I am trying to shutdown a database server in the Application_End event
> > > handler on the Global.asax page. So far I am trying this only on the
> > > development server that comes with Visual Studio 2005. When I close
> > > the browser, this does not cause the Application_End event to trigger.
> > > It also will not occur when I shut down the development server. At
> > > this point the application is no longer running, so why didn't the
> > > event handler ever get called?
> >
> > > Any suggestions or guesses will be appreciated.
> > > Thanks- Hide quoted text -
> >
> > - Show quoted text -
>
> Thanks for taking the time to answer my question. This is my first web
> app that I'm doing for my company. One thing that I don't understand
> about the web application life cycle is what will ever cause the
> application to end when no more requests are coming in? Will it just
> continue to remain in memory until the server is shut down? I'm
> thinking that there probably is a time out setting somewhere, but I
> don't know where it would be at this point.
>
>