Constant constant variable asp.Net/C#

When I update the .dlls in my ASP.Net C.Net application, the transition is handled gracefully and the users are allowed to finish their requests before the code is switched to the new code.

My question is, are static variables reset when this is done or are they persisted via update (unless of course the static objects themselves are updated in the code)?

+1


source to share


2 answers


Yes, they are lost and re-created, the DLL makes the application domain stop and restart. All cache and other items are re-populated and generated as used / needed.



You should look at persistent storage if these values ​​are to be persisted for any actual time period, as your AppDomain can and does get reloaded for many other reasons.

+4


source


Yes, the application restarts. If you need to store these values, you may need some kind of out-of-process caching model, such as from process caching, SQL Server state management, or a third-party caching solution that lives outside the application domain.



0


source







All Articles