C# app does not load image list resources

  • Thread starter Thread starter Will Pittenger
  • Start date Start date
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?
 
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
 
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.)
 
Back
Top