Please Help me: Exception thrown by target of an invocation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I create a C# Project using Windows Application template,

I add an imagelist to Form, and add icon to imagelist1.

After that, I run Project, but an Exception has occured. I can fix it even
reinstall Visual Studio .NET 2003

this is the Code auto-generated by VSS:
_____________________________

this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth16Bit;
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); // <== Break here
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
_____________________________

When run project, an Error dialog has been raised and stop at line:

this.imageList1.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));

_____________________________
An unhandled exception of type
'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

Additional InformationL Exception has been thrown by the target of an
invocation
_____________________________

Please Help me as soon as possible. I had search a lot of Bug and FIX from
MSDN Website, Microsoft Website but there is no solved issues.

Thanks a lot.
 
Looks like your Resource isn't where your app thinks it is.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
The only thing I do is Adding a new Icon to it only using Design view to do.
I do not add any my code line.

How can I correct this ?
 
Back
Top