Hi, cutting and pasting the configuration file to app.config doesn't work.
This is my current app config:
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="hibernate-configuration" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </configSections>
<!-- This template was written to work with NHibernate.Test. Copy the template to your NHibernate.Test project folder and rename it in hibernate.cfg.xml and change it for your own use before compile tests in VisualStudio. --> <!-- This is the System.Data.dll provider for SQL Server --> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" > <session-factory name="NHibernate.Test"> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="connection.connection_string"> Data Source=192,168.5.101;Initial Catalog=HelloNHibernate;User Id =nh;Password=123456! </property> <property name="adonet.batch_size">10</property> <property name="show_sql">false</property> <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property> <property name="use_outer_join">true</property> <property name="command_timeout">60</property> <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> </hibernate-configuration> </configuration>
This throws an exception on the xmlns="urn:nhibernate-configuration-2.2" if I remove this, it will throw an exception on the next line (unrecognized element...) the c# code that activate the exception is: static ISession OpenSession() { ---> Configuration c = new Configuration(); c.AddAssembly(Assembly.GetCallingAssembly()); ISessionFactory f = c.BuildSessionFactory(); return f.OpenSession(); }
What should I do ? what should be the factory name (if not test ?)
Thanks, Dani
|