Does anyone know what this error might mean?

  • Thread starter Thread starter craig
  • Start date Start date
C

craig

Quick question for the experts...

Whenever I set the Image property of a PictureBox on one of my windows forms
to a
PNG graphic file on my hard drive, I get the following runtime error when I
try to run the app:

Exception Type: System.Resources.MissingManifestResourceException
Message: Could not find any resources appropriate for the specified culture
(or the neutral culture) in the given assembly.

Any idea what this error might be referring to or how to approach correcting
it??

Thanks!!
 
when you develop the code it places the graphic into a resource file for
that c# source to reference it against. Then when it's compiled it gets
placed into the ".exe"

Your exception seems to be suggesting that this cycle isn't taking place?

Are you using the Sharpdevelop IDE? they had a bug with resource files a
while back.
 
Thanks for the response. Actually, I am using Visual Studio. After
searching the web, I notice alot of messages with people saying they get
this error message under similar conditions, but no one seems to know how to
go about fixing it.
 
Well, it's been a long time but I think I remember I got a similar error a
while back. Its been a while so I don't really remember what I did to fix it
but I think what fixed it was deleting the "bin" and "obj" folders form the
project and recompiling the project again. After you recompile, the folders
will be recreated again and hopefully the error will go away.



Nothing to loose by trying it, just make a backup of the project just in
case.... you never know!!
 
When all else fails, I've experienced a few situations where deleting
the bin and obj directories and starting fresh will solve the
problem.
 
craig said:
Quick question for the experts...

Whenever I set the Image property of a PictureBox on one of my windows
forms to a
PNG graphic file on my hard drive, I get the following runtime error when
I
try to run the app:

Exception Type: System.Resources.MissingManifestResourceException
Message: Could not find any resources appropriate for the specified
culture
(or the neutral culture) in the given assembly.

Ahh, my old favorite.

In your form, did you define any classes *before* the form? That includes
enums, delegates, etc.

The system sometimes craps out if the form isn't the first class in a given
file.
 
Daniel O'Connell said:
Ahh, my old favorite.

In your form, did you define any classes *before* the form? That includes
enums, delegates, etc.

The system sometimes craps out if the form isn't the first class in a
given file.

YES! There are several classes that were added to the project before I
added the form that I am having the problem with. Did you find out how this
creates a problem or how to get around the problem???
 
C.G. Oh said:
Include the PNG file into your default resource file.

How do you include something in the default resource file?? I am not sure
how to go about doing that.
 
Thanks for the input...

I just tried this but it doesn't seem to have solved the problem. I
continue to get the same error.
 
Someone else suggested this as well. I just tried it, but I still get the
error.

Thanks for taking the time to respond!!
 
When all fails, your last resource is to create a new project and simply add
the existing files to the project.



PS: At one time I did this because of some errors I was getting and the
project ended up running about 3 times faster then before, I have no idea
what Visual Studio was doing but creating the new project and importing the
old files fixed the problem and made a huge impact on performances. Don't
ask why!!!
 
Rene said:
When all fails, your last resource is to create a new project and simply add
the existing files to the project.



PS: At one time I did this because of some errors I was getting and the
project ended up running about 3 times faster then before, I have no idea
what Visual Studio was doing but creating the new project and importing the
old files fixed the problem and made a huge impact on performances. Don't
ask why!!!

the class name must be the same as the cs-filename from the maineform,
look:

classname = MyForm, filename = Form1.cs it make this error

classname = MyForm, filename = MyForm.cs it make no error

why?? the VS make automatically resourcen-file in the obj directory
from the classname, like so: "TestPictureBox.MyForm.resources"
somtimes, VS not refresh this filename when you rename the classname
from the mainform. i don`t no wy vs make this problem, but this way
fixed my problem
 
Back
Top