Hi ,
I am having connection problem while trying to connect my sqldatabase from nhibernate, i am getting the following error.
The ProxyFactoryFactory was not configured. Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers. Example: <property name='proxyfactory.factory_class'>NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> Example: <property name='proxyfactory.factory_class'>NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
now here i am putting my configuration file please take a look.
<?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="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="connection.connection_string">Server=(arindam);initial catalog=MyDatabaseName;userid=myUserId;password=myPassword;Integrated Security=SSPI; </property> <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> <!--<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>--> <property name='proxyfactory.factory_class'>NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> <property name="show_sql">true</property> </session-factory> </hibernate-configuration> </configuration>
II will be using nhibernate through WCF service My.net class library => WCF Service
public class SessionModule {
private static ISession m_session; private static ISessionFactory m_sessionFactory;
public SessionModule() { // log4net.Config.XmlConfigurator.Configure(); Configuration cfg = new Configuration(); m_sessionFactory = cfg.BuildSessionFactory();// here i am getting error } } Please let meknow whats going wrong with the configuration ?
|