By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,526 Members | 2,207 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,526 IT Pros & Developers. It's quick & easy.

Please Help me: Exception thrown by target of an invocation

P: n/a
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)(resource s.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)(resource s.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.
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.

"Minh" <Mi**@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
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)(resource s.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)(resource s.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.

Nov 17 '05 #2

P: n/a
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 ?

"Kevin Spencer" wrote:
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.

"Minh" <Mi**@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
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)(resource s.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)(resource s.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.


Nov 17 '05 #3

P: n/a
Anyone help me ?

"Minh" wrote:
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)(resource s.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)(resource s.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.

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.