473,320 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Application_End event handler not getting called on developmentserver

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
Jan 10 '08 #1
5 5149
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*******@yahoo.comwrote in message
news:dd**********************************@f47g2000 hsd.googlegroups.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

Jan 11 '08 #2
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.comwrote in message

news:dd**********************************@f47g2000 hsd.googlegroups.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.

Jan 11 '08 #3
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" <CT*******@yahoo.coma écrit dans le message de news:
c2**********************************...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:dd**********************************@f47g2000 hsd.googlegroups.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.
Jan 11 '08 #4
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" <CT*******@yahoo.comwrote in message
news:c2**********************************@l6g2000p rm.googlegroups.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.comwrote in message

news:dd**********************************@f47g2000 hsd.googlegroups.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.
Jan 11 '08 #5
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.comwrote in message

news:dd**********************************@f47g2000 hsd.googlegroups.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.

Jan 11 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: sushi | last post by:
Hello, When is Application_End event called? Actually, I am developing a web application which will start some operation that will continue to run even when the session of all the user's end...
2
by: Craig | last post by:
Hi, I'm having difficulty understanding how the Application_End event in the Global.asax file gets called. I thought that it's called when the specific web site is stopped via the IIS management...
3
by: Jim Owen | last post by:
My .Net book states that the Application_End event handler in Global.asax gets called typically about 20 minutes after the last HTTP request. My question is: what is the best way to debug my...
4
by: Halcyon Woodward | last post by:
I have an odd problem... We have a small development team (three coders) working on the same project (a C# web application). Each coder has a unique 'sandbox' site on a shared Windows 2003...
4
by: Vlad Hrybok | last post by:
I am using Application_End to send out a notification about application being unloaded. I found that those notifications are not being sent because the app seems to get unloaded without...
12
by: Jack Russell | last post by:
My unstanding of all VB up to and including vb6 is that an event could not "interrupt" itself. For instance if you had a timer event containing a msgbox then you would only get one message. ...
2
by: Ralph | last post by:
Hi I don't understand why it's not working: function schedule(imTop){ this.tdImagesTop = imTop; } schedule.prototype.selectEl = function() { alert(this.tdImagesTop);
3
by: wolverine | last post by:
Hi, I am injecting a javascript code into html pages and attaching some dom events to some elements via attachEvent (IE only). I just want to know that is there any chance by which my event...
2
by: =?Utf-8?B?SGV6YWw=?= | last post by:
Hi, I am trying to add a new record to a table but everytime I click the button, somehow it saves the record twice... I've created a stored procedure to insert records into a table and I called...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.