Additional information: Exception has been thrown by the target of an invocation.

  • Thread starter Thread starter Pawe³ Skowron
  • Start date Start date
P

Pawe³ Skowron

Hi,
I have .dll with Form and ImageList component,
when I'm making instance, I got execption:

An unhandled exception of type 'System.Reflection.TargetInvocationException'
occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an
invocation.

at line:
this.imglToolBar.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imglToolBar.I
mageStream")));

What is wrong?

thx in andvance

pawel
 
Pawe³ Skowron said:
Hi,
I have .dll with Form and ImageList component,
when I'm making instance, I got execption:

An unhandled exception of type 'System.Reflection.TargetInvocationException'
occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an
invocation.

at line:
this.imglToolBar.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imglToolBar.I
mageStream")));

What is wrong?

thx in andvance

pawel

Those kind of errors are difficult to troubleshoot.

Put a try/catch around the code which makes the instance, and examine the
InnerException property of the TargetInvocationException. It should lead
you to a better description. My guess is that your GetObject call is
returning Null for some reason, and the cast is failing.

Best Regards,

Andy
 
Any other suggestions?
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imglToolBar.I

Those kind of errors are difficult to troubleshoot.

Put a try/catch around the code which makes the instance, and examine the
InnerException property of the TargetInvocationException. It should lead
you to a better description. My guess is that your GetObject call is
returning Null for some reason, and the cast is failing.

Best Regards,

Andy
 
Back
Top