Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application_End Not Running

Tags:

c#

asp.net

I'm new to C#, so please bear with me.

I have a function that runs in the Application_Start function in the Global.asax.cs file, and this works fine when I start debugging.

But when I stop debugging, the function I have in the Application_End function doesn't seem to fire off. I'm wondering if this has to do with debugging, or is just an error in my code.

like image 799
user3413723 Avatar asked Sep 05 '14 15:09

user3413723


1 Answers

I guess the application never ended. While you are debugging (using Cassandra or IIS Express) or running an installation on IIS itself the application doesn't end when your debugging session ends.

On IIS it ends when the worker process stops. This happens automatically after some time, depending on your application pool settings.

In Cassandra and IIS Express it will happen when the process ends gracefully. I wonder if they get ever called on a regular basis on those installations.

like image 171
Patrick Hofman Avatar answered Sep 21 '22 06:09

Patrick Hofman