Imagelist emptying and not compiling
Hello,
There are three reasons can cause this problem:
1) Did you add a new class before the line saying "class Form1"?
If so, don't do that. This breaks resources in the VS IDE.
2) Did you change your default namespace so that everything is in the new
namespace?
If not, then you should probably do this. Or did you recently move Form1
into the new namespace? Especially make sure the ResX file is in the new
namespace. (I don't know how to control this via the IDE.)
3) Is your ResX file named Form1.resx?
It should be.
If none of these helps, then run ildasm on your binary, double click on the
assembly manifest, then look for any .mresource entries. You should find
one mentioning Form1.resources (or some variant of that name). Your goal
is to get that name to match the name the ResourceManager uses, which it
gave you in the exception message ("Form1.resources").
I hope it is helpful.
Best regards,
Lion Shi, MCSE, MCSD
Microsoft Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. 2001 Microsoft Corporation. All rights
reserved.
--------------------
Subject: Imagelist emptying and not compiling
Date: Wed, 5 Jun 2002 14:50:45 +0100
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Newsgroups: microsoft.public.dotnet.languages.CSharp
NNTP-Posting-Host: 212.157.192.115
Path: cpmsftngxa07!tkmsftngp01!tkmsftngp04
Xref: cpmsftngxa07 microsoft.public.dotnet.languages.csharp:65954
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
Hi
I am using an imagelist in my form.
When trying to run the app I keep getting the exception
"'System.Resources.MissingManifestResourceException' occurred in
mscorlib.dll, because the resources cannot be found."
I have replicated the image list (under a different name) as i had
changed
the namespace and wondered if there was a tie to the old namespace.
Still no change.
Any ideas what might have caused this?
Additional to this, the image list is actually emptying during
initialisation of the app.
If the solution has built successfully then should the compiler not
know if,
at run time, the image list is in fact invalid?
The following code is the declaration to initialise the imagelist
imagestream
this.databaseImageList.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("databaseImage
List.ImageStream")));
the databaseImageList.ImagStream is naturally null - this code is from
the
InitializeComponent and is generated by the environment.