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

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
 
A

Andy Becker

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
 
P

Pawe³ Skowron

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
 
A

Andy Becker

Pawe³ Skowron said:
Any other suggestions?

None from me. Did you try the InnerException thing, and not get any
meaningful information?

Best Regards,

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top