Reflection: Member not found error, but member exists---help.

  • Thread starter Thread starter phrankbooth
  • Start date Start date
P

phrankbooth

I keep getting a "Member not found." error when invoking a method that
I know is there.

Here is the method in the DLL in which I'm calling it:
public virtual new System.String GetLDetls (System.String theStr1,
System.String theStr2, System.Boolean isTF)


Here is the invoke call in my code:
result = theCfgType.InvokeMember (aMethod, BindingFlags.InvokeMethod,
null, theTargetObj, aArgs);

Is it possible that an older version of the DLL is stuck in the GAC?
Although I can't see it there.

I've tried other binding flags to no avail.

Is there something I'm missing??

Any help appreciated, thanks!!

--PhB
 
Is it possible that an older version of the DLL is stuck in the GAC?

You can check the version of the loaded assembly with
theCfgType.Assembly.GetName().Version and see if it was loaded from
the GAC with theCfgType.Assembly.GlobalAssemblyCache.

Although I can't see it there.

Then it's probably not there.

I've tried other binding flags to no avail.

Is there something I'm missing??

Have you tried getting the MethodInfo first with theCfgType.GetMethod,
and then invoke it with MathodInfo.Invoke?


Mattias
 
I keep getting a "Member not found." error when invoking a method that
I know is there.

Here is the method in the DLL in which I'm calling it:
public virtual new System.String GetLDetls (System.String theStr1,
System.String theStr2, System.Boolean isTF)


Here is the invoke call in my code:
result = theCfgType.InvokeMember (aMethod, BindingFlags.InvokeMethod,
null, theTargetObj, aArgs);

Is it possible that an older version of the DLL is stuck in the GAC?
Although I can't see it there.

I've tried other binding flags to no avail.

Is there something I'm missing??

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
Back
Top