2 using System.Diagnostics;
3 using System.Threading;
4 using System.Threading.Tasks;
10 ManualResetEvent mre = new ManualResetEvent (false);
12 ThreadPool.QueueUserWorkItem (_ => { try { throw new AppDomainUnloadedException (); } finally { mre.Set (); } });
14 if (!mre.WaitOne (5000))
17 /* Wait for exception unwinding */
21 static void ThrowThread ()
23 Thread thread = new Thread (_ => { throw new AppDomainUnloadedException (); });
28 static int Main (string[] args)