namespaces, folders, and embedded files

  • Thread starter Thread starter Patrick
  • Start date Start date
P

Patrick

Hello All,
I'm getting into nHibernate for a project at work. I've organized my xml
files into a folder within the project and have chosen to embed them into
the assembly. However, the nHIbernate framework cannot find the xml files
because they are in the "folder". Could someone explain how namespaces and
folders work with the compiler? Or could offer any tips?

Many thanks to all,
Patrick
 
Ok, I found a method called AddResource("resource name").
I need to re-phrase my question. How do you reference a resource that is in
a "folder"?

Many thanks to all,
Patrick
 
lets say your projects' namespace is ScaryApp and within the project you have
a folder called ScaryStuff and there you have an icon Scary.ico. So in order
to access that resouce you call it like that:
"ScaryApp.ScaryStuff.Scary.ico". As you can see, you CAN have stuff placed in
folders and access them as embedded resources and all the slashes are
replaced by full stops.
 
and if you don't know exactly how to access the resources, then this method
gives you all the resources with their addresses:
Assembly.GetExecutingAssembly().GetManifestResourceNames()

hope this helps
 
Back
Top