namespaces, folders, and embedded files

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
 
P

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
 
G

Guest

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.
 
G

Guest

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
 

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