System.Resources.MissingManifestResourceException

G

Guest

I'm trying to use an ImageComboBox in my app. The control worked fine in a
demo app, but the contructor throws a
System.Resources.MissingManifestResourceException with the text:

"Could not find any resources appropriate for the specified culture (or the
neutral culture) in the given assembly. Make sure
\"TreeViewContainer.resources\" was correctly embedded or linked into
assembly \"ImageComboBox\".\r\nbaseName: TreeViewContainer locationInfo:
TSC.UserInterface.ExtendedComponents.ImageComboBox.TreeViewContainer resource
file name: TreeViewContainer.resources assembly: ImageComboBox,
Version=1.0.2153.16846, Culture=neutral, PublicKeyToken=null"

I commented out the few lines where I was changing the culture to geta
different default timestamp format, and am using nuetral culture exclusively
throughout my app so I'm not sure what the problem is.

With experimentation it seems that the moving of the source from
solution\project\ to solution\project\src\ or the changing of the namespace
from the provided default to one fitting our apps hierarchy will cause the
exception to be thrown.

Custom control:
http://www.codeproject.com/cs/miscctrl/ImageComboBoxControl.asp#xx1245940xx
 
G

Guest

Dan Neely said:
I'm trying to use an ImageComboBox in my app. The control worked fine in a
demo app, but the contructor throws a
System.Resources.MissingManifestResourceException with the text:

More info. The exception is being thrown while attempting to load the image
list in InitializeComponents() The second line of the codeblock is
exceptional.

this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
 
G

Guest

Hi,

I'm having the same problem (but in VB.NET).

I studied the problem a little bit further. For some reason, the .resource
files that get generated / embedded in the assembly have a wrong name. Also,
the problem occurs only for some projects. I have several projects that work
just fine, but one problematic class library. I tried creating the project
again from scratch using the existing source code files - no luck.

If you use reflector and check your resources, you should see
"Namespace.MyClass.resource", but when it's bugging, the resource file is
named "MyClass.resource". The same thing can be seen from the obj folder
under the project folder.

How does the VS.NET2005 determine the names of the resource files? I found
this:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q318603

but it discusses VS.NET2003 and none of my code files have anything between
the namespace and the class declaration. And my VS.NET2003 is clearly
different from the one discussed in the workaround...

- Product review next week...
 

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