void A(object o) { ... Assembly a = Assembly.LoadFile(...); Type t = a.GetType(@"namespace.className"); MethodInfo mi = t.GetMethod(@"MethodName"); mi.Invoke(instace, new Object[] {o}); .... } the method I need to invoke accept another type, I need to cast the object to that type, but, the type is known only at run time, so can I convert/cast object to another type known only at run time ? I can change only method A.
thank you.
MethodName? That's the only reason I can think of to need the argument type.