Do ou get the same error, when you skip the AddFile ? What is happening when you use one of the other methods:
Code:
//cfg.AddAssembly(typeof(NHibernate_Demo.Customer).Assembly);
//cfg.AddClass(typeof(Customer));
cfg.AddFile("Customer.hbm.xml");
//Opens a session to NHiberbate to allow us to work with objects
ISessionFactory sessionsF = cfg.BuildSessionFactory();
You can set the build action when you right click the file in the solution explorer. In the "Advanced" part you have a property called "Build Action". You have to set it to "Embedded Resource" for all hbm.xml files if you want to use AddClass or AddAssembly. If you use AddFile, afaik it's not necessary.
Something else. NHibernate_Demo is the wrong assembly name here, should be NHibernate !
Code:
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate_Demo" />
If you're new to NHibernate, try this:
http://nhforge.org/wikis/howtonh/your-first-nhibernate-based-application.aspx