I have some loosely coupled code that depends on a specific assembly being loaded into the current application domain:
Assembly assembly = AppDomain.CurrentDomai
This is the wrong way and it can cause serious timed bugs.
The setting affects ASP.NET compilation, so it only forces loading the assembly when ASP.NET views are compiled and they are compiled at most once - either on first request to the view or during the in-place precompilation process if the latter is setup. Anyway there will be a moment of time ofter which no ASP.NET view needs to be compiled.
Now there's IIS apppool automatic recycle every 29 hours. When the pool recycles it starts a new worker process and that process starts hosting the site payload. What's important is that ASP.NET views don't change during this process and so they need not be recompiled and so the compilation process is not invoked and so the assemblies listed in <system.web><compilation><assemblies>
are not forcibly loaded.
So the thing looks working until 29 hours pass and then it just falls apart.
A better solution is needed. Something like a setting in <appSettings>
saying whether Azure Runtime should be available. If the setting is set, the code then can make a first call to code inside Azure Runtime assemblies and this will make them load. if the setting is not set it doesn't try to call that code.