You may encounter a number of issues while working through the above
quickstart; here are some tips:
(1) Don't forget to name your assembly; in Visual Studio 2005 go to
the project menu and select <projectname> properties at the bottom of
the menu. Here make sure the Assembly Name is equal to the one you're
using in your .hbm.xml mapping files and specifying in your
AddAssembly call.
(2) In both versions I tried (1.0.2.0 and 1.2.0.Alpha1) I got
an "method get_Id() should be virtual" error. To allow dynamic proxy
generation in your class you must add a virtual modifier to all you
accessors, like this:
public virtual string Id
{
get { return id; }
set { id = value; }
}
(3) If you get an "invalid column name" exception even when you're
sure the column names are correctly spelled in the mapping file, try
using a fully qualified name for the database table, for example:
<class name="NHibernate.Examples.QuickStart.User,
NHibernate.Examples" table="[NHibernate].[dbo].[Users]"> |