NHibernate.Cfg.Configuration is a class. Configure() is a public method in the class.
If you use any file other than hibernate.cfg.xml, which is the default, you must tell NHibernate where to find the configuration information (it odes not use app.config or web.config unless you specify that file and where to find it. John Davidson On Wed, Jun 8, 2011 at 9:38 AM, scottl2001 <[email protected]>wrote: > > hmmm.... I'm using NHibernate.Cfg.Configuration(), which does not take > any arguments... > > > > On Jun 7, 5:42 pm, John Davidson <[email protected]> wrote: > > You should tell your configuration which file contains the configuration > > data and where it is: > > > > configuration = new > > > Configuration().Configure(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, > > "app.config")); > > > > John Davidson > > > > On Tue, Jun 7, 2011 at 3:27 PM, scottl2001 <[email protected] > >wrote: > > > > > > > > > Hello all. > > > > > I'm having trouble setting things up for a mini application I'm using > > > in order to do table mappings in nhibernate. > > > > > My App.config is set up as : > > > > > *************************************************** > > > > > <?xml version="1.0" encoding="utf-8" ?> > > > <configuration> > > > <configSections> > > > <section name="hibernate-configuration" > > > type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/ > > > > > </configSections> > > > <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> > > > <session-factory> > > > <property name="hibernate.connection.provider"> > > > NHibernate.Connection.DriverConnectionProvider > > > </property> > > > <property name="hibernate.connection.driver_class"> > > > NHibernate.Driver.SqlClientDriver > > > </property> > > > <property > > > name="hibernate.connection.connection_string"> > > > Server=bsp-appdevxxx;Database=BSPDataCenter;User > > > Id=runprog;Password=xxxxxxxxx > > > </property> > > > <property name="hibernate.dialect"> > > > NHibernate.Dialect.MsSql2005Dialect > > > </property> > > > <property name="show_sql"> > > > false > > > </property> > > > </session-factory> > > > </hibernate-configuration> > > > </configuration> > > > > > **************************** > > > > > Using session to do the work: > > > > > ******************************* > > > > > ISessionFactory sessionfactory; > > > > > Configuration config = new Configuration(); > > > config.AddAssembly(typeof(classname).Assembly); > > > sessionfactory = config.BuildSessionFactory(); > > > > > *********************************** > > > > > The final statement (BuildSessionFactory) results in the error > > > > > "The hibernate.connection.driver_class must be specified in the > > > NHibernate configuration section." > > > > > even though I have it specified in the config file above > > > > > Any ideas? > > > > > Thanks > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "nhusers" 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/nhusers?hl=en.- Hide quoted text - > > > > - Show quoted text - > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" 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/nhusers?hl=en. > > -- You received this message because you are subscribed to the Google Groups "nhusers" 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/nhusers?hl=en.
