4 using System
.Net
.Sockets
;
5 using System
.Threading
;
9 static void AppDomainMethod () {
10 Console
.WriteLine ("two");
11 var socket
= new Socket (AddressFamily
.InterNetwork
, SocketType
.Stream
, ProtocolType
.Tcp
);
12 IPEndPoint ep
= new IPEndPoint(IPAddress
.Any
, 0);
15 socket
.BeginAccept ( delegate {
16 Console
.WriteLine ("Delegate should not be called!");
22 var da
= AppDomain
.CreateDomain ("le domain");
23 da
.DoCallBack (delegate { AppDomainMethod ();}
);
24 Console
.WriteLine ("unloading");
25 AppDomain
.Unload (da
);
26 Console
.WriteLine ("done");