Updating ASP.NET Assemblies
I posted a comment on Rick Strahl’s post on Server Errors when updating live Web applications online about a technique to update assemblies of live apps. I use the following approach:
1) I only keep the
assemblies unlikely to change in bin (i.e. components, third-party libs
etc.). I put my app’s assemblies into a sub-folder of bin and name the
folder according to the date (for example: bin\20080801)
2) My web.config has the following:
I need to update assemblies, I just upload them into a new sub-folder
in bin, again with a name corresponding to the current date
(bin\20080812). After the upload is complete, I upload web.config with
a change to the sub-folder name. The app re-starts and picks up the new
assemblies and forgets about the old sub-folder assemblies which I can
leave or delete.
Seems to work and has the added benefit of speeding up the app start since the sub-folder assemblies are ignored until needed.