I am using AppDomain to isolate assembly loading and in some cases, the AppDomain.Unload(customDomain) never return (I suspect this is due to some thread usage).
I plan to put the AppDomain.Unload call in a separate Task, time it, and if nothing happen in x milliseconds, I just move on. I could also restart the process but it is more costly. So how bad is AppDomain leaking ?
For the context: I programmaticaly change an assembly, write it on disk, load it in a new appdomain, run some tests on it then I unload the appdomain and restart the same routine with a new version of the assembly.