Lets say i have a method looking like this:
public void Time([Channel] string channel)
{
Console.WriteLine(channel);
}
I now want to invoke this method using:
method?.Invoke(module, new string[] { "Test" });
The problem I'm having is that this will throw a TargetException with the message "Object does not match target type".
It works fine if i remove the parameter attribute [Channel].
Aucun commentaire:
Enregistrer un commentaire