PC Review


Reply
Thread Tools Rate Thread

Application_End event handler not getting called on developmentserver

 
 
Tenacious
Guest
Posts: n/a
 
      10th Jan 2008
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
 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      10th Jan 2008
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" <(E-Mail Removed)> wrote in message
news:dd3b4ff9-3b01-4c2b-8f8c-(E-Mail Removed)...
>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



 
Reply With Quote
 
Tenacious
Guest
Posts: n/a
 
      11th Jan 2008
On Jan 10, 3:56*pm, "Juan T. Llibre" <nomailrepl...@nowhere.com>
wrote:
> re:
> !> When I close the browser, this does not cause the Application_End eventto 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" <CT_Tay...@yahoo.com> wrote in message
>
> news:dd3b4ff9-3b01-4c2b-8f8c-(E-Mail Removed)...
>
>
>
> >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.

 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      11th Jan 2008
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" <(E-Mail Removed)> a écrit dans le message de news:
c28d29ab-a667-46af-b1d2-0737219cc943...oglegroups.com...
On Jan 10, 3:56 pm, "Juan T. Llibre" <nomailrepl...@nowhere.com>
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" <CT_Tay...@yahoo.com>
> wrote in message
>
> news:dd3b4ff9-3b01-4c2b-8f8c-(E-Mail Removed)...
>
>
>
> >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.


 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      11th Jan 2008
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" <(E-Mail Removed)> wrote in message
news:c28d29ab-a667-46af-b1d2-(E-Mail Removed)...
On Jan 10, 3:56 pm, "Juan T. Llibre" <nomailrepl...@nowhere.com>
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" <CT_Tay...@yahoo.com> wrote in message
>
> news:dd3b4ff9-3b01-4c2b-8f8c-(E-Mail Removed)...
>
>
>
> >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.


 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      11th Jan 2008
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" <nomailrepl...@nowhere.com>
> 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" <CT_Tay...@yahoo.com> wrote in message
> >
> > news:dd3b4ff9-3b01-4c2b-8f8c-(E-Mail Removed)...
> >
> >
> >
> > >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.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event handler never called. glenwilkin Microsoft ASP .NET 1 21st Aug 2006 07:39 PM
Re: Application_Startup event handler not being called Michael Kairys Microsoft Outlook VBA Programming 0 1st Aug 2005 12:12 AM
Application_Startup event handler not being called Michael Kairys Microsoft Outlook VBA Programming 1 31st Jul 2005 02:30 AM
When is Application_End event called? =?Utf-8?B?c3VzaGk=?= Microsoft C# .NET 0 14th Jun 2005 03:18 PM
Event Handler Not Called. =?Utf-8?B?U2hyZXlhc2ggQi4gUGF0ZWw=?= Microsoft ASP .NET 2 16th Aug 2004 05:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:16 PM.