invokemember error

  • Thread starter Thread starter crain
  • Start date Start date
C

crain

hi i am trying to invoke a member but this code gives me an error

obj = t.InvokeMember(m.Name, BindingFlags.DeclaredOnly Or
BindingFlags.Public Or BindingFlags.NonPublic Or BindingFlags.Instance Or
BindingFlags.InvokeMethod, Nothing, New Object, Nothing)

kindly help

m.name is just a method helo in my assembly
 
"System.Reflection.TargetException: Object does not match target type.
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParameters)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder
binder, Object target, Object[] args)
at WindowsApplication4.Form1.Form1_Load(Object sender, EventArgs e) in
E:\Practice\ReflectionInvokemember\Form1.vb:line 73"
 
Back
Top