Kenno’s OpenNote

NHibernate.MappingException: Unknown entity class

Posted in C#, Windows by kenno on May 26, 2009

If you get MappingException error, there are two things you should check out:

  • Make sure the name of the *.hbm.xml is spelled correctly — not *.hmb.xml nor *.mbh.xml
  • Make sure the Build Action property is set to “Embeded Resource.”

I learned this the hard way. First, I wrongly spelled hbm.xml and I had its Buld Action property set to “Content”. The above 2 points fixed the problem.

Credit: VerySimple, Inc

Tagged with: