3 using System
.Security
.Policy
;
4 using System
.Threading
;
5 using System
.Runtime
.Serialization
;
10 public struct c2
: ISerializable
{
14 private c2 (SerializationInfo info
, StreamingContext context
) {
15 a
= info
.GetInt32("a");
16 s1
= info
.GetString("s1");
19 public void GetObjectData (SerializationInfo info
, StreamingContext context
) {
20 info
.AddValue ("a", a
);
22 info
.AddValue ("s1", s1
);
24 info
.AddValue ("s1", "(null)");
32 public string s1
= "TEST1";
33 [NonSerialized
] public string s2
= "TEST2";
39 Console
.WriteLine ("Friendly name: " + AppDomain
.CurrentDomain
.FriendlyName
);
41 AppDomainSetup setup
= new AppDomainSetup ();
42 setup
.ApplicationBase
= Directory
.GetCurrentDirectory ();
44 AppDomain newDomain
= AppDomain
.CreateDomain ("NewDomain", null, setup
);
50 newDomain
.SetData ("TEST", a1
);
52 c1 r1
= (c1
)newDomain
.GetData ("TEST");
54 if (r1
.a
!= 1 || r1
.b
!=2)
69 Console
.WriteLine("test-ok");