1

Today I updated my project to NHibernate 3.3 and replaced the NHibernate and the Iesi.Collections References.

I kept NHibernate.ByteCode.Castle I removed the line <property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property> from my application config. Now I get the error NotSupportedException in the last line of the following code:

NHibernate.Cfg.Configuration cfg = new NHibernate.Cfg.Configuration();
cfg.AddAssembly(Assembly.GetExecutingAssembly());
sessionFactory = cfg.BuildSessionFactory();

I googled a lot but I don't have a clue what's wrong. And ideas? Thanks!

my config:

  <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
  <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
  <property name="dialect">NHibernate.Dialect.PostgreSQLDialect</property>
  <property name="connection.driver_class">NHibernate.Driver.NpgsqlDriver</property>
  <property name="connection.connection_string">Server=myserverip;Port=myport;database=my_test;User Id=my_user;Password=mypwd;CommandTimeout=1;</property>
  <!--<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>-->
  <property name="command_timeout">0</property>
</session-factory>

prolink007
  • 33,872
  • 24
  • 117
  • 185
Verena Haunschmid
  • 1,252
  • 15
  • 40

1 Answers1

3

Just add this line to your xml config

<property name="hbm2ddl.keywords">none</property>

More details described here: C# / Postgres / FluentNHibernate : configuring npgsql throws NotSupportedException

Community
  • 1
  • 1
tonic
  • 31
  • 3