We have an ASP.NET MVC website in C#, and when they publish new code, they don't usually restart the web server. This can cause problems because some code changes might assume that new code called in App_Start fired, or some lookup values in static variables might be outdated relative to code changes.
What I'm thinking of doing to solve this problem is to have a static variable set to AssemblyName.Version. Then on any web request, I would have code check AssemblyName.Version against the static variable, and if it's different, it would update that static variable and run certain code to refresh caches and perform certain tasks that would normally be run by App_Start.
What I'm wondering is whether there's any better way of handling this. Surely this is a common situation, so I'd be curious how others are handling this.