I just started nHibernate , I tried quick start but I Receive this error when I try to run it :
“File or assembly name NHibernate.Examples, or one of its dependencies, was not found.”
All I did was this:
Making User class.
Making database .
Making User.hbm.xml as a map and define its Build action as Embedded Resources .
Add nhibernate.dll as a reference
And adding
using NHibernate;
using NHibernate.Cfg;
to top and Entering this code in my Page Lode :
Code:
Configuration cfg = new Configuration();
cfg.AddAssembly("NHibernate.Examples");
ISessionFactory factory = cfg.BuildSessionFactory();
ISession session = factory.OpenSession();
ITransaction transaction = session.BeginTransaction();
NHibernate.Examples.QuickStart.User newUser = new NHibernate.Examples.QuickStart.User();
newUser.Id = "joe_cool";
newUser.UserName = "Joseph Cool";
newUser.Password = "abc123";
newUser.EmailAddress = "
[email protected]";
newUser.LastLogon = DateTime.Now;
// Tell NHibernate that this object should be saved
session.Save(newUser);
// commit all of the changes to the DB and close the ISession
transaction.Commit();
session.Close();
I know Its very firstly problem, but I really cant solve it by myself.
so please help me ;)