How to load xml resource file under a folder in a .Net project

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

If my xml resource file is directly under my project file, I have no problem
to load that xml file via Assembly.GetManifestResourceStream. However, after
I create a folder under the project and move my xml file under that folder, I
cannot load that xml file via Assembly.GetManifestResourceStream. Every time
it returns null. Any idea?

Thanks in advance!!!
Cindy
 
Are you using Visual Studio? It uses the folder name as prefix of the
resource name.

You can see what embedded resources are in your assembly like this:

foreach (string aResourceName in
Assembly.GetExecutingAssembly().GetManifestResourceNames())
{
Console.WriteLine(aResourceName);
}

Christian
 
Back
Top