Could be a number of things but the root cause is that
the embedded resource name does not match that which
you are trying to create your ResourceManager with.
The easiest way to figure out that matchup problem is
to use ildasm and look at the manifest information.
Look at the entry for the resource you added.  The
namespace and resource name has to match the first
parameter to your ResourceManager constructor call.

Right now you have "Images".  Which could be okay
depending on how you compiled and embedded the
resource into the assembly.  If you used VS.Net, by
default this will most likely be wrong as the default
namespace that is specified in the project settings is
prepended to the resx name.

That is, most likely, you would need to have made your
ResourceManager constructor paramters be:

new ResourceManager("WindowsApplication1.Images",
this.GetType().Assembly);

Also note the more maintainable way of getting the
assembly reference.

This is the typical scenario where I've seen this
problem, the other typical scenario where this error
occurs is when people are compiling with the command
line compiler and forget to compile in the default
resources to the main assembly.  Again, you'll be able
to tell what the problem is by looking at the manifest
information using ildasm.

Jim


Date:    Wed, 5 Feb 2003 18:16:51 -0800
> From:    Sphinx <[EMAIL PROTECTED]>
> Subject: How to use .resx file
>
> Hai
>
> I have One  file named Images.resx. I have embedded
> this file into my project and I have following code.
>
> Assembly thisAssembly =
>
Assembly.GetAssembly(Type.GetType("WindowsApplication1.Form1"));
> ResourceManager rmListImages = new
> ResourceManager("Images", thisAssembly);
> ImageList imageList = new ImageList();
> imageList.ImageSize = new Size(16, 16);
> Bitmap icons =
> (Bitmap)rmListImages.GetObject("IconsList");
>
> When I am running the above code it is showing the
> following error.
>
> An unhandled exception of type
> 'System.Resources.MissingManifestResourceException'
> occurred in mscorlib.dll
>
> Additional information: Could not find any resources
> appropriate for the specified culture (or the
> neutral culture) in the given assembly. Make sure
> "Images.resources" was correctly embedded or linked
> into assembly "WindowsApplication1".
> baseName: Images locationInfo: resource file name:
> Images.resources assembly: WindowsApplication1,
> Version=1.0.0.0, Culture=neutral,
> PublicKeyToken=null
>
> Can any body suggest how to solve this.
> Chito.




__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Reply via email to