I have the following class tree:
public class A { public static object GetMe(SomeOtherClass something) { return something.Foo(); } } pub
You need to pass BindingFlags.FlattenHierarchy flag to GetMethod in order to search up the hierarchy:
BindingFlags.FlattenHierarchy
GetMethod
typeof(C).GetMethod("GetMe", BindingFlags.FlattenHierarchy, null, new Type[] { typeof(SomeOtherClass) }, null)).Invoke(null, parameter));