When Application_End is called in asp.net WebService

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

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

I have a piece of code that I need to run only once on the first IIS call and again after the last IIS call (and between retries), and I cannot run it on every WebService request and response ...

+3
source share
1 answer

Application_End- exactly what you are looking for; The application is unloaded in accordance with the setting that you set, but by default it will continue to work for a certain period of inactivity after any requests are received or it will work while requests are constantly being received.

Please note that other things can cause the application pool to be updated and therefore cause Application_Endto be called; a certain number of recompilations (due to modified aspx files, etc.), a certain period of time, a certain amount of pressure in memory, etc. Again, they are all configurable, but are usually set to reasonable defaults.

, , Application_Start Application_End, , , , ,

, , , . , Start End. , AppDomain . ( .) , , ; !


EDIT: , ! , , Application_End .

+8

Source: https://habr.com/ru/post/1782413/


All Articles