2 using System
.Security
.Policy
;
3 using System
.Threading
;
7 [LoaderOptimization (LoaderOptimization
.SingleDomain
)]
8 static int arg_sum (string[] args
) {
10 foreach (string s
in args
) {
11 res
+= Convert
.ToInt32 (s
);
20 AppDomainSetup setup
= new AppDomainSetup ();
21 setup
.ApplicationBase
= ".";
23 Console
.WriteLine (AppDomain
.CurrentDomain
.FriendlyName
);
25 AppDomain newDomain
= AppDomain
.CreateDomain ("NewDomain", null, setup
);
27 string[] args
= { "1", "2", "3"}
;
28 res
= newDomain
.ExecuteAssembly ("appdomain-client.exe", null, args
);
29 if (res
!= arg_sum (args
))
32 Console
.WriteLine ("test-ok");