Blog Home  Yalcomania'n�n Yeri Feed your aggregator (RSS 2.0)  
Yalçın Uzun - Nhibernate Kullanılan Web Projelerinde Güvenlik Hatalarının Önlenmesi
Kişisel Blog
 
 Wednesday, June 06, 2007

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>

 

Wednesday, June 06, 2007 8:01:58 PM (GTB Standard Time, UTC+02:00)  #    Comments [0]    | 
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Copyright © 2008 Yalçın Uzun