// 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.Reflection; namespace E { public class M { public static void Trace(object sender, AssemblyLoadEventArgs args) { Console.WriteLine("Loaded: " + args.LoadedAssembly.Location); } public static void Main(string[] args) { AppDomain.CurrentDomain.AssemblyLoad += new AssemblyLoadEventHandler(Trace); object o1 = new C1(); Console.WriteLine(o1); object o2 = Assembly.Load("D2").CreateInstance("E.C2"); Console.WriteLine(o2); } } }