Error binding to target method
问题 MethodInfo method = typeof(T).GetMethod("Parse", new[] { typeof(string) }); parse = Delegate.CreateDelegate(typeof(Func<T,string>), method); T is a float in this case. However I am getting a Error binding to target method. Parse I believe is a static method. I have looked at other examples, but I can not figure out why it is not binding. 回答1: you have to swap T and string because the method returns a T not a string . I replaced T with float and following code works for me: MethodInfo method =