C# app does not load image list resources

W

Will Pittenger

It throws an exception when executing the line below.

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

The exception reads "Unhandled Exception:
System.Resources.MissingManifestResourceException: Could not find any
resources appropriate for the specified culture (or the neutral culture) in
the given assembly. Make sure "appName.resources" was correctly embedded or
linked into assembly 'appName'." What gives? My image is was set up with
the form editor. What am I doing wrong?
 
W

Wiktor Zychla

The exception reads "Unhandled Exception:
System.Resources.MissingManifestResourceException: Could not find any
resources appropriate for the specified culture (or the neutral culture) in
the given assembly. Make sure "appName.resources" was correctly embedded or
linked into assembly 'appName'." What gives? My image is was set up with
the form editor. What am I doing wrong?

this exception is usually caused by putting the other classes BEFORE the
form class in the source file. it means that you can't have

public class A { ... }
public class myForm : Form { ... }

in the source file. you have to change it to

public class myForm : Form { ... }
public class A { ... }

I hope this helps you.
Regards, Wiktor Zychla
 
W

Will Pittenger

I did add something before the form class, but that was an enum. I assume
that would also trigger the problem? I also assume you are talking about
two classes in the same file as there is no #include directive. (I am a
C++/MFC person and only started with C# last month.)
 

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