2 using System
.Threading
;
7 AppDomain
.CurrentDomain
.UnhandledException
+= OnUnhandledException
;
12 static void OtherDomain ()
14 AppDomain domain
= AppDomain
.CreateDomain ("test");
15 ThreadPool
.QueueUserWorkItem (unused
=> {
16 domain
.DoCallBack (() => {
17 AppDomain
.CurrentDomain
.SetData ("key", "checked");
19 // This will get a ThreadAbortedException
24 if (!SpinWait
.SpinUntil (() => domain
.GetData ("key") as string == "checked", 10000))
27 AppDomain
.Unload (domain
);
30 static void OnUnhandledException (object sender
, UnhandledExceptionEventArgs e
)