Monday, February 15, 2010

NHibernate.MappingException: No persister for ...

When I tried to save I got this ADOException: Could Not Save Object...After googling I found the solution that I forgot to set the build action of *.hbm.xml file to "Embeded Resouce".

and it solved my problem.... :)

TIP from NHibernate quick-start guide: If you are using Visual Studio .NET to compile make sure that you set the Build Action of the User.hbm.xml file to Embedded Resource. The mapping file will now be a part of the Asssembly. The subtle detail's importance will be evident later.

Chers by,

Anand Ranjan