I have a assembly which contains a class. That class has two methods
public IEnumerable Invoke();
public IEnumerable<T> Invoke<T>();
I dynamically load the assembly
Assembly as = Assembly.Load("MyAssemblyName, Version= 6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
Type type = as.GetType("MyClass");
object myObject= Activator.CreateInstance(type);
IEnumerable test= (IEnumerable)myObject.GetType().InvokeMember("Invoke", BindingFlags.InvokeMethod, null, myObject, null);
I want this method is called: public IEnumerable Invoke();
when I run the program I got an error: Ambiguous match found
So what needs to do to remove the ambiguity, so the non-generic method to be called?
Thanks in advance.