473,785 Members | 2,824 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Application_End event handler not getting called on developmentserv er

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 5200
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*******@yaho o.comwrote in message
news:dd******** *************** ***********@f47 g2000hsd.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

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/
=============== =============== ========"Tenaci ous" <CT_Tay...@yaho o.comwrote in message

news:dd******** *************** ***********@f47 g2000hsd.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.

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*******@yaho o.coma écrit dans le message de news:
c2************* *************** **...legroups .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/
=============== =============== ========"Tenaci ous" <CT_Tay...@yaho o.com>
wrote in message

news:dd******** *************** ***********@f47 g2000hsd.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.
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 "Performanc e" 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 "Applicatio n 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*******@yaho o.comwrote in message
news:c2******** *************** ***********@l6g 2000prm.googleg roups.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/
=============== =============== ========"Tenaci ous" <CT_Tay...@yaho o.comwrote in message

news:dd******** *************** ***********@f47 g2000hsd.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.
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_sta rt 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/
=============== =============== ========"Tenaci ous" <CT_Tay...@yaho o.comwrote in message

news:dd******** *************** ***********@f47 g2000hsd.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.

Jan 11 '08 #6

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

Similar topics

0
1848
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 timeout's. I want to save the state of that operation when the IIS Server is stopped.
2
7705
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 console. Could anyone please tell me where I can dispose of objects when wanting to stop a specific web site without having to explicitly run IISRESET, as I have other web sites that I am not allowed to reset on the same machine and calling...
3
16128
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 Application_End code? I could of course add a button or something to a form to run the code explicitly, but I want to be sure it is really getting called after 20 minutes. I assume that if I put a breakpoint in my Application_End code, and then run the...
4
7088
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 where they can test the code they write. The majority of the code is written into a stand-alone class library shared via VSS, that is then referenced by each sandbox web (each of which is unique to each user). In the stand-alone class library, we...
4
9225
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 Application_End ever being called. We started logging Application_Start and Application_End events and found that the number is not even: Application_Start happen more often than Application_End. My question is: What are the sutuations in which we should...
12
4143
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. However in vb.net you get continual messages (even setting the system modal property). Firstly, are these two assumptions right and if so what is the approved
2
2657
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
2366
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 handler not getting executed ? ie, is there some means for the web developer to prevent any further handler getting executed for the same event on the same element ? To be more clear, assume the web developer has attached function "f1()" on onclick...
2
3245
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 that procedure in the code that I attached to a button click. Here is the event handler code which is created automatically: this.AddCustomer.Click += new System.EventHandler(this.AddCustomer_Click); I checked the stored procedure and the code...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10324
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10090
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9949
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.