Imagelist causes exception 
Author Message
 Imagelist causes exception

When I add an ImageList to my form and add an image to its Images property,
I get the following exception when I run the application at this line in
InitializeComponents:

this.imageList1.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.Im
ageStream")));

----------------------------------------------------------------------------
-----
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 group assembly. Make sure
that "MainForm.resources" is properlu embedded or linked into assemnly
"TestApp".

basename.MainForm locationinfo TestApp.MainForm.resource file.
------------------------------------------------------------------------

I added the image to the project in Solution Explorer. I don't have a
MainForm.resourcee file. I don't know what to do. Can anyone please help me?
Thanks...

--
Scott



Mon, 01 Nov 2004 03:27:34 GMT  
 Imagelist causes exception
Hello Scott,

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 causes exception
    Date: Wed, 15 May 2002 15:27:34 -0400
    Lines: 29
    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: 12-220-128-138.client.insightbb.com 12.220.128.138
    Path: cpmsftngxa08!tkmsftngp01!tkmsftngp05
    Xref: cpmsftngxa08 microsoft.public.dotnet.languages.csharp:61109
    X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

    When I add an ImageList to my form and add an image to its Images
property,
    I get the following exception when I run the application at this line in
    InitializeComponents:

    this.imageList1.ImageStream =

((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.Im
    ageStream")));

----------------------------------------------------------------------------
    -----
    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 group assembly. Make
sure
    that "MainForm.resources" is properlu embedded or linked into assemnly
    "TestApp".

    basename.MainForm locationinfo TestApp.MainForm.resource file.
    ------------------------------------------------------------------------

    I added the image to the project in Solution Explorer. I don't have a
    MainForm.resourcee file. I don't know what to do. Can anyone please
help me?
    Thanks...

    --
    Scott



Tue, 02 Nov 2004 11:07:13 GMT  
 Imagelist causes exception
Hi Lion,

Quote:
> 1) Did you add a new class before the line saying "class Form1"?

Yes, I did. I removed them front the Form1.cs file and moved them to their
own files (one per class). Now everything works fine. Thank you very much.

--
Scott


Quote:
> Hello Scott,

> 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 causes exception
>     Date: Wed, 15 May 2002 15:27:34 -0400
>     Lines: 29
>     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: 12-220-128-138.client.insightbb.com 12.220.128.138
>     Path: cpmsftngxa08!tkmsftngp01!tkmsftngp05
>     Xref: cpmsftngxa08 microsoft.public.dotnet.languages.csharp:61109
>     X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

>     When I add an ImageList to my form and add an image to its Images
> property,
>     I get the following exception when I run the application at this line
in
>     InitializeComponents:

>     this.imageList1.ImageStream =

((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.Im

- Show quoted text -

Quote:
>     ageStream")));

> --------------------------------------------------------------------------
--
>     -----
>     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 group assembly. Make
> sure
>     that "MainForm.resources" is properlu embedded or linked into assemnly
>     "TestApp".

>     basename.MainForm locationinfo TestApp.MainForm.resource file.
>     ----------------------------------------------------------------------
--

>     I added the image to the project in Solution Explorer. I don't have a
>     MainForm.resourcee file. I don't know what to do. Can anyone please
> help me?
>     Thanks...

>     --
>     Scott




Tue, 02 Nov 2004 21:34:55 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. A crash probelm (maybe caused by ImageList)

2. .Net meory leak(caused by imagelist)

3. exception with ImageList - a general question

4. managed C++ wrapper around unmanaged C++ classes: causing StackOverflow exception

5. mixed mode DLL causing non-continuable exception during process load

6. Boxin/Unboxing a bool causes exception

7. Turning on optimisations causes exceptions

8. Whole Program Optimization causes Catastrophic Failure exception

9. Why does end of file causes exception?

10. CreateMeasurementGraphics().GetHdc() causes exception in debug only

11. General Protection Exception Causes?

12. What causes Floating point exceptions?

 

 
Powered by phpBB® Forum Software