while Loading the Dll using Relection-Getting "Exception has been thrown by the target of an invocation"

Posted by Srikrishna777 under C# on 2/19/2010 | Views : 1578 | Status : [Member] | Replies : 3
Hi,

I am trying to load a Dll at runtime using Reflection and I am getting the "Exception has been thrown by the target of an invocation" .
I have seen the Innermessage of that exception and it is saying that one control in my form is missed.when I see my dll in the Reflector ,I am able to see the control.I dont know how I am getting that message.
I have tried with latest dlls in my application.But,not able to solve.

Can anyone please tell me how to go ahead in this issue.

Thanks,
M.Srikrishna Murthy




Responses

Posted by: Vuyiswamb on: 2/19/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Can we see the line of code that is giving you this error

Thank you for posting at Dotnetfunda
[Administrator]

Srikrishna777, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhi2434 on: 2/19/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
Well I would recommend to look at the Signature of the method. It might happen that the Signature of the Object differs with the signature you specify while calling InvokeMember.

Another thing that you need to look is the Access Specifier specified for the invoked member. See if the control is declared as Internal / Private / Protected etc.

It might also happen that the object that you pass during the call mismatches. Put a breakpoint and inspect the object before you call.

www.abhisheksur.com

Srikrishna777, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 2/24/2010 [Member] Bronze

Up
0
Down
Check
http://social.msdn.microsoft.com/Forums/en-US/vstsprofiler/thread/8bd8da75-76d2-4257-aeee-d040e6167bf9

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Srikrishna777, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response