Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3605238
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:05:56+00:00 2026-05-18T21:05:56+00:00

When exactly does the Application_End fire in the case of a WebService ?? I

  • 0

When exactly does the Application_End fire in the case of a WebService ??

I read (Application_End global.asax) that the Application_End is called everytime the application is unloaded. Does this mean after every call to a method in a web service ?

I have a piece of code that I need fired only once on the first call to the IIS, and again after the last call to the IIS (and between recycles), and I can’t have it being fired upon every WebService request and response…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:05:56+00:00Added an answer on May 18, 2026 at 9:05 pm

    Application_End is exactly what you are looking for; The application is unloaded according to the configuration you set, but by default it will continue running for a certain amount of time of being idle after any requests come in, or it will remain running while requests are continually coming in.

    Note that other things can cause the App Pool to refresh, and therefore cause Application_End to be called; a certain number of recompiles (due to changed aspx files, etc), a certain time period running, a certain amount of memory pressure, etc. Again, these are all configurable, but are set to reasonable defaults, generally.

    The key thing to keep in mind is that you can expect there to be some time between Application_Start and Application_End, but you can’t know how much time there will be, based on what is happening on the server.

    Also note that when an App Pool is recycled, already-running requests are not stopped suddenly, and they may in fact overlap with new requests being handled by the new process. This means that an old app pool’s End might be called after the new app pool’s Start. But this should not matter, because each app has it’s own AppDomain, and doesn’t share data. (but sometimes that can explain otherwise weird behavior.) Oh, and finally; even that is configurable, too!


    EDIT: One more thing to add! Note that if the server is taken down suddenly, Application_End would not be called.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What exactly does immutable mean - that is, what are the consequences of an
Can anyone tell me what exactly does this Java code do? SecureRandom random =
Writing a JSP page, what exactly does the <c:out> do? I've noticed that the
Exactly that: Does a strings length equal the byte size? Does it matter on
What exactly does the word patch mean when referring to 'submitting a patch'? I've
What exactly does null do performance and storage (space) wise in MySQL? For example:
How exactly does NSInvocation work? Is there a good introduction? I’m specifically having issues
What is the difference between == and === ? How exactly does the loosely
I've seen the @ symbol used in PowerShell to initialise arrays. What exactly does
I'm trying to figure out what the following line does exactly - specifically the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.