// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Runtime.Serialization.Formatters.Soap; namespace E { [Serializable] public class C1 { public C2 Other { get; set; } } [Serializable] public class C2 { public C1 Other { get; set; } } public class Program { public static void Main(string[] args) { C1 o1 = new C1(); C2 o2 = new C2(); o1.Other = o2; o2.Other = o1; SoapFormatter ser = new SoapFormatter(); ser.Serialize(Console.OpenStandardOutput(), o1); } } }