Thanks for the postings, I'll take a look at it first chance I get after work ;) To Jame's point, I think he's actually along a better line of thinking than myself, which is, are you using the Fluent's version of NHibernate (and other dependent classes) in your entire solution consistently? You can't mix and match unfortunately. I believe that the fluent library is depending on the public GA of NHibernate. If you have a more recent version of NHibernate (say an alpha or the like), you'll need to grab fluent's source, swap out the nhibernate reference, and rebuild fluent.
On Tue, Apr 28, 2009 at 11:11 AM, jimmarq <[email protected]> wrote: > > I left 3 classes in my library: ProductMap, Product, and DBHelper. I > still get the error. Here are the 3 classes: > > public class ProductMap : ClassMap<Product> > { > public ProductMap() > { > Id(x => x.Id); > Map(x => x.Category); > Map(x => x.Discontinued); > Map(x => x.Name); > } > } > > public class Product > { > public virtual int Id { get; set; } > public virtual string Name { get; set; } > public virtual string Category { get; set; } > public virtual bool Discontinued { get; set; } > > } > > public class DBHelper > { > private static ISessionFactory _sessionFactory; > > private static ISessionFactory SessionFactory > { > get > { > if (_sessionFactory == null) > { > _sessionFactory = Fluently.Configure() > .Database > (SQLiteConfiguration.Standard.UsingFile("nhibernate.db")) > .Mappings(m => > m.FluentMappings.AddFromAssemblyOf<Product>()) > .ExposeConfiguration(BuildSchema) > .BuildSessionFactory(); > } > return _sessionFactory; > } > } > > public static ISession OpenSession() > { > return SessionFactory.OpenSession(); > } > > private static void BuildSchema(Configuration config) > { > if (File.Exists("nhibernate.db")) > File.Delete("nhibernate.db"); > > new SchemaExport(config).Execute(false, true, false, > false); > } > > } > > > Here is what I'm calling in a separate assembly that triggers the > Exception. > > //This code fails > using (ISession session = DBHelper.OpenSession()) > { > //empty > } > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---
