Imagelist emptying and not compiling 
Author Message
 Imagelist emptying and not compiling

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.



Sun, 21 Nov 2004 21:50:45 GMT  
 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.



Mon, 22 Nov 2004 23:02:51 GMT  
 Imagelist emptying and not compiling
Thanks for that info
There was a class that was added and it was before the form class.
This solved the problem straight away.


Quote:
> 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

- Show quoted text -

Quote:
>     List.ImageStream")));

>     the databaseImageList.ImagStream is naturally null - this code is from
> the
>     InitializeComponent and is generated by the environment.



Fri, 26 Nov 2004 17:31:17 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Setting not Null field to ""(empty string) does not work with CRecordset

2. Setting not Null field to ""(empty string) does not work with CRecordset

3. Problem with compiling an empty ATL project.

4. listview-listctrl - image does not disappear completely the after removing the imagelist

5. Finding out whether the ClipBoard is empty or not

6. Initializer list can not be empty

7. when ;; is not an empty statement

8. delete directory which is not empty

9. delete directory which is not empty

10. How to delete directory which is not empty?

11. Query for fields that are not empty.

12. Can not create empty document Error

 

 
Powered by phpBB® Forum Software