The dreaded “NHibernate.MappingException: Unknown entity class” exception thrown by NHibernate in your .NET web application indicates that the class you are trying to map in your .hbm.xml file cannot be located for some reason.
The first thing to check is to right-click on each of your .hbm.xml files and make sure the Build Action property is set to “Embeded Resource.” This tells .NET to compile the mapping file into the Assembly .dll
If you confirmed that the Build Action is correct then for some reason NHibernate cannot locate your class within the project. Double check that the path to your class is correct. If you’re building a .NET 2.0 website and your model code is inside the App_Code directory, make sure that you have specified the Assembly name of “App_Code”. The .NET framework automatically creates this assembly name for your web project.
Hi from Mexico!
Thank you so much!!
in web.config
did it for me
thanks for this blog
Thanks a lot!! Works for me “set to “Embeded Resource.””.
Tks GENIO!!!!!
Thanks man !!!
thanks a lot
Thanx man
wah wah ..
.. thanks alot
Thanks
Thanks a lot…..
Thanks,Guys I have faced the same problem but my mistake was incorrect file name.
I have typed user,nbm.xml insterad of user.hbm.xml.
Cheers..
thanks alot
I am getting the error when the iSession.save(“[className]“) method runs
Please help
And check that your file is correctly named .hbm.xml
<== YOu saved my life!!!
superb..nice solution..just we need to add in configuration file…
Thanks buddy you saved my lot’s of time. I got little bit confident in NHibernet