dimanche 21 avril 2019

PrivateObject Invoke with a string variable

I got a problem when I try to run a private method with PrivateObject

PrivateObject target = new PrivateObject(typeof(ControlMaster));

string name = "CheckTransportJob";
var value2 = target.Invoke(name, new object[] { "" });

will throw exception ControlMaster.CheckTransportJob not found, but if

var value1 = target.Invoke("CheckTransportJob", new object[] { "" });

run everything fine.

what's difference? and how to solve it?





Aucun commentaire:

Enregistrer un commentaire