views:

1972

answers:

2

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

My question is do the static variables reset when that is done or do they persist through the update (if of course the static objects themselves aren't updated in the code)?

+4  A: 

Yes, they are lost and recreated, the DLL forces the application domain to stop and restart. All cache and other items are re-filled and created as used/needed.

You must look at a persistent store if these values are to be retained for any actual amount of time as your AppDomain can and does restart for many other reasons as well.

Mitchel Sellers
A: 

Yes, the application is restarted. If you need to persist these values, you might want to look at some sort of out-of-process caching model, such as out of process caching, SQL Server State Management, or a third-party caching solution that lives outside of the application domain.

joseph.ferris