I am having problems in my ASP.NET 2.0 website with adding my mapping files correctly (or at least I think).
I have tried mapping with attributes, manually adding the hbm.xml by path, and putting the classes and hbm.xml files in a seperate class project and then adding the assembly.
I keep getting: Unknown entity class: Library.Player exception when I try to save a new object.
Right now I have the classes and mapping files in an assembly and then trying to add it.
Here is where I add the assembly:
Code:
NHibernate.Cfg.Configuration config = new NHibernate.Cfg.Configuration();
config.AddAssembly(typeof(Library.Player).Assembly);
NHibernate.ISessionFactory factory = config.BuildSessionFactory();
This is my Player.hbm.xml file located in the same assembly:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Library.Player, Library" table="player">
<id name="Username" column="username">
<generator class="assigned"/>
</id>
<version name="Version" column="version"/>
</class>
</hibernate-mapping>
What do I need to go to get it to load the configuration correctly?