including resource files

G

Guest

vb2005
i have a resource file (MyFile.resources) created using resgen.
how do i inculde it within my assembly? i have tried adding it to my project
but it does not get built into the exe, so i get a
MissingManifestResourceException when trying to use resources within it.

any ideas?
 
A

Armin Zingler

guy said:
vb2005
i have a resource file (MyFile.resources) created using resgen.
how do i inculde it within my assembly? i have tried adding it to my
project but it does not get built into the exe, so i get a
MissingManifestResourceException when trying to use resources within
it.

any ideas?


Select the file in the solution explorer. In the property window, did you
set the "build action" to embedded resource?


Or, maybe you misspelled the resource name. Try this at application startup
to see the embedded resources:

MsgBox(String.Join(vbCrLf, _
System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceNames _
))



Armin
 
G

Guest

thanks Armin,
yes it has Build Action set to Embedded Resource.
looking at it witl ILDasm does not show the resource, nor does
GetMainfestResourceNames in your example - i must be doing something else
wrong!
 
A

Armin Zingler

guy said:
thanks Armin,
yes it has Build Action set to Embedded Resource.
looking at it witl ILDasm does not show the resource, nor does
GetMainfestResourceNames in your example - i must be doing something
else wrong!


Hmm.. strange. I tried the same now: I used "reseditor.exe" (from the
samples), added one bitmap, saved as "test.resources", added the file to the
project ("embedded resource" is set by default) and built the exe.
GetManifestResourceNames returns


WindowsApplication1.Form1.resources
WindowsApplication1.test.resources
WindowsApplication1.Resources.resources

where "test.resources" is the embedded file.

I currently have no clue what's going wrong in your project.... I'll let you
know if something comes into my mind.



Armin
 

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