I'm trying to work off of the NHibernate 1.0.2 tutorial with VS.NET 2005. Surely through my own fault, I'm unable to save my first NHibernate object. The error I get when running a web page with code behind page load event to save my Cat is:
NHibernate.MappingException: Unknown entity class: QuickStart.Cat
What I did to get this was to put in my web.config:
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.0">
<session-factory>
<property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
<property name="hibernate.connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.connection_string">Server=(local);Database=Northwind;Trusted_Connection=True;</property>
<mapping assembly="QuickStart"/>
</session-factory>
</hibernate-configuration>
And my project has a reference to an assembly QuickStart, which has verbatim the Cat.cs class and Cat.hbm.xml file from the tutorial. Which to say, the mapping file starts with:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"
namespace="QuickStart" assembly="QuickStart">
<class name="Cat" table="Cat">
and the Cat.cs file properly notes the namespace it belongs to as QuickStart.
Any help with where I went wrong would be appreciated. (The version of NHibernate I am using is 1.2.0.Alpha1-Debug)
_________________ Chad Price
|