Set the property hibernate.dialect error message

Posted by user281180 on Stack Overflow See other posts from Stack Overflow or by user281180
Published on 2010-12-28T09:46:17Z Indexed on 2010/12/28 9:54 UTC
Read the original article Hit count: 320

I am having the following error when configuring mvc3 and Nhibernate. Can anyone guide me what I have missed please.

the dialect was not set. Set the property hibernate.dialect. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: NHibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect.

Source Error:

Line 16: { Line 17: NHibernate.Cfg.Configuration configuration = new NHibernate.Cfg.Configuration(); Line 18: configuration.AddAssembly(System.Reflection.Assembly.GetExecutingAssembly()); Line 19: sessionFactory = configuration.BuildSessionFactory(); Line 20: }


My web.config is as follows:

<configSections>
<section name="cachingConfiguration"type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings,Microsoft.Practices.EnterpriseLibrary.Caching"/>
<section name="log4net"type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
<section name="hibernate-configuration"type="NHibernate.Cfg.ConfigurationSectionHandler,

NHibernate"/>

  <appSettings>
    <add key="BusinessObjectAssemblies" value="Keeper.API"></add>
    <add key="ConnectionString" value="Server=localhost\SQLSERVER2005;Database=KeeperDev;User=test;Pwd=test;"></add>
    <add key="ClientValidationEnabled" value="true"/> 
    <add key="UnobtrusiveJavaScriptEnabled" value="true"/> 
  </appSettings>



<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory>
      <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
      <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
      <property name="connection.connection_string">Server=localhost\SQLServer2005;Database=KeeperDev;User=test;Pwd=test;</property>
      <property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
    </session-factory>
  </hibernate-configuration>

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about asp.net-mvc-2