3 // Regression test for bug #428054
7 class Program
: MarshalByRefObject
9 static int Main (string[] args
)
11 Program p
= new Program ();
12 Client client
= Client
.CreateInNewAppDomain ();
13 client
.Completed
+= p
.CompletedHandler
;
14 if (client
.Run () != AppDomain
.CurrentDomain
.FriendlyName
)
20 public string CompletedHandler ()
22 return AppDomain
.CurrentDomain
.FriendlyName
;
26 class Client
: MarshalByRefObject
28 public delegate string StringDel ();
29 public event StringDel Completed
;
31 public static Client
CreateInNewAppDomain ()
33 AppDomain clientDomain
= AppDomain
.CreateDomain ("client");
34 return (Client
) clientDomain
.CreateInstanceAndUnwrap (
35 typeof(Client
).Assembly
.FullName
, typeof(Client
).FullName
);