I am trying to retrieve the MethodInfo “ToString” as follows:
MethodInfo method = MyType.GetMethod("ToString",
BindingFlags.Public | BindingFlags.Instance);
An exception is being thrown “Ambiguous match found”.
ToString()is a member ofSystem.Objectand thus it is one of the very few methods that you don’t need reflection for when you wat to call it on an unknown Type.The exception is in the overloads for Tostring (ie
int.ToString(string format)but to call one of those you have to know which one you’re looking for.And those overlaods cause the error you see. You will have to be specific.