Talk:Getting started
From Fluent NHibernate
A note for x64 users:
I wanted to note that two projects are built for x86 processor: FluentNHibernate.Testing and Examples.FirstProject. This means that to run the unit tests on an x64machine, you need to run nunit-x86.exe, not nunit.exe.
If you attempt to run the unit tests on a x64 machine with nunit.exe there will be a cryptic error message: "System.IO.FileNotFoundException : Could not load file or assembly 'FluentNHibernate.Testing' or one of its dependencies. The system cannot find the file specified."
This is a limitation of the build of SQLite.dll, not Fluent.NHibernate. You can choose a different database provider, you'll want to be sure the build supports x64. SQLite.dll could also be built for x64.
ProxyFactory configuration missing
The database configuration inside CreateSessionFactory is missing the ProxyFactoryFactory invocation. Since issue 154 is a wontfix, a line
.ProxyFactoryFactory("NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle") will be need to be added to database configuration call. Mine looks like this:
return Fluently.Configure().Database(SQLiteConfiguration.Standard.UsingFile("firstProject.db").ProxyFactoryFactory("NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle"))
Hi Folks, I like the tutorial, but I'm having / had some issues.
For all your sample code, PLEASE always include the using statements.
Also, I'm using VS 2008 Pro. Out of the box, it likes to create new classes like
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace nHibernateReference.Entities {
class Employee { public virtual int Id { get; private set; } public virtual string FirstName { get; set; } public virtual string LastName { get; set; } public virtual Store Store { get; set; } }
}
Which will not compile until you take out the namespace.
For clarity, you might consider putting the entire code chunk in the pages verbatim.
I love nHibernate and have used it on several projects, but this lack of attention to the small details ( maybe because I'm just not experienced enough with c# ) is a truly frustrating experience when I'm trying to sell nHibernate to a new Employer.
Please do keep up the excellent work, and also please do go through your own tutorials doing exactly what they show. Then go back and make things clearer where necessary. It will help new folks immensely.