Ever wonder why you get a mysterious MissingManifestResourceException? The fallowing
message board post describes this problem. Or you can go to http://www.dotnet247.com/247reference/msgs/25/125704.aspx
to see the original posting. NOTE: Link current as of August 1, 2003.
Felix Wu(MS) [@online.microsoft.com]
Hi Srini,
Are you talking the MissingManifestResourceException? This problem can occur when
the resource can not be successfully loaded.
Do you have any custom classes defined before the default Form1 class? Since the
compiler use the name of the first class as the default resource name for the form.
For example, you can find similar lines in the assembly's manifest (Note: You can
check the compiled assemblies using ildasm.exe utility):
.mresource public WindowsApplication1.Form1.resources
{
}
As you can see, "Form1" is from the name of the first class in the code module.
If you put another class, "MyClass" for example, before the "Form1" class, the resource
name will be changed to "WindowsApplication1.MyClass.resources". This makes the
call:
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
fail to locate the resource.
If this is not the case, please explain a little bit more about problem, and I'm
glad to look into it.
Regards,
Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.