Nhibnernate'i webde kullanırken güvenlik ayarlarından dolayı oldukça zorluk çektim.godaddy'de host edilen web projem sürekli izinlerden dolayı çatlıyordu.Uzun araştırmalardan sonra web config'i aşağıdaki gibi düzenleyerek bu hatalardan kurtuldum.Önemli olan nokta "nhibernate" adlı bir configsection açılması ve reflection kullanımının kapatılması. Aynı satır nhibernate-configuration section'unda olursa yine çalışmıyor.
<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" requirePermission="false"/>
<section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
<nhibernate>
<add key="hibernate.use_reflection_optimizer" value="false"/>
</nhibernate>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="hibernate.dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.connection_string">server=.;database=XXXX;User ID=XXX;Password=XXX;</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
</session-factory>
</hibernate-configuration>
Remember Me