I had a chat with Levi and Pradeep (both are the devs on the ASP.NET team), and this does appear to be a bug in ASP.NET's compilation system. We have a filed a bug and will try to get this fixed in a future release of ASP.NET.
However, in the meantime, we think we've found a workaround that is worth trying: In the place(s) where you call BuildManager.AddReferencedAssembly and pass in the dynamically-selected assembly, also add a call to BuildManager.AddCompilationDependency and pass in your own string(s) that reflect the identity of the assembly. For example, you could pass in the assembly name or its path or anything like that. Check out MSDN for some more info on this method: http://msdn.microsoft.com/en-us/library/system.web.compilation.buildmanager.addcompilationdependency
It would be great if you could try out this workaround and see if it resolves your problem. Hopefully in the future the bug in ASP.NET will be fixed and this workaround won't be needed anymore.
Can you please let us know if the workaround works?
However, in the meantime, we think we've found a workaround that is worth trying: In the place(s) where you call BuildManager.AddReferencedAssembly and pass in the dynamically-selected assembly, also add a call to BuildManager.AddCompilationDependency and pass in your own string(s) that reflect the identity of the assembly. For example, you could pass in the assembly name or its path or anything like that. Check out MSDN for some more info on this method: http://msdn.microsoft.com/en-us/library/system.web.compilation.buildmanager.addcompilationdependency
It would be great if you could try out this workaround and see if it resolves your problem. Hopefully in the future the bug in ASP.NET will be fixed and this workaround won't be needed anymore.
Can you please let us know if the workaround works?