using System; using System.Reflection; using System.Globalization; using System.Runtime.Remoting; class App { static void Main() { try { object obj = UseActivator( "lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3bf941bb1f722efe"); InvokeObject(obj); } catch(Exception e1) { Console.WriteLine(e1.Message); } } static object UseActivator(string name) { ObjectHandle oh = Activator.CreateInstance(name, "LibraryCode"); return oh.Unwrap(); } static void InvokeObject(object obj) { Type type = obj.GetType(); MethodInfo mi = type.GetMethod("GetVersion"); string version = (string)mi.Invoke(obj, null); Console.WriteLine(version); } }