Il costruttore si presenta così:Come arrivare costruttore come MethodInfo utilizzando la riflessione
public NameAndValue(string name, string value)
ho bisogno di ottenere come un MethodInfo utilizzando la riflessione. Ha provato quanto segue, ma non trova il costruttore (GetMethod
restituisce null
).
MethodInfo constructor = typeof(NameAndValue).GetMethod(".ctor", new[] { typeof(string), typeof(string) });
Cosa sto sbagliando?
sapevo già come ottenere il ConstructorInfo, ma ho pensato che avevo bisogno MethodInfo, mentre è stato richiesto solo MethodBase. Grazie per la tua risposta però. –