I have a system which loads assemblies into an appdomain and then hands out object proxies to other domains (basically a simple IoC container). We need to achieve very high uptime, and being able to update implementations at runtime helps this a lot.
I've go no problems with this in that I can fire up a new appdomain, load new assemblies into that and start handing out proxies to the nice new objects while currently executing code contines with the old objects. All is well, except that at some point I would like to unload the old appdomain.
Is there a way to check if all the proxies pointing to objects in a particular appdomain have gone out of scope so I can safely call unload without killing any long running processes?