Now, before you say it: I did Google and my hbm.xml
file is an Embedded Resource.
Here is the code I am calling:
Something obvious, yet quite useful for someone new to NHibernate.
All XML Mapping files should be treated as Embedded Resources rather than the default Content. This option is set by editing the Build Action attribute in the file's properties.
XML files are then embedded into the assembly, and parsed at project startup during NHibernate's configuration phase.
Don't forget to specify mapping information in .config file
e.g.
where MyApp.Data is assembly that contains your mappings
My issue was that I forgot to put the .hbm in the name of the mapping xml. Also make sure you make it an embedded resource!
To add to Amol's answer, don't make the mistake of specifying the Interface class type. Make sure you specify the implementation class. (Ie. don't use IDomainObjectType). Not that I made this mistake... :)