關於castle和Could not find the dialect in the configuration錯誤

最近試了試castle,NND,總是報「Could not find the dialect in the configuration」,明明配的沒問題,上網搜索全部教程都是這麼配的。後來在一國外的網站解決NHibernate的問題的帖子,看的一哥們說把hibernate去了試試,當時也沒試(關鍵是那帖子說這個辦法沒解決問題)。囧rz,今天試了試,竟然解決問題了。估計可能和castle的版本有關係(順便說一下castle網站的源碼的例子也是不對的,NND)。但願遇到一樣錯誤的哥們能搜到此文章。
原配置:
<configSections>
<section name="activerecord" type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler, Castle.ActiveRecord" />
</configSections>
<activerecord>
<config>
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
<add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect" />
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="hibernate.connection.connection_string" value="UID=sa;Password=sa;Initial Catalog=ARDemo;Data Source=." />
</config>
</activerecord>
正確配置:
<configSections>
<section name="activerecord" type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler, Castle.ActiveRecord" />
</configSections>
<activerecord>
<config>
<add key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
<add key="dialect" value="NHibernate.Dialect.MsSql2000Dialect" />
<add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="proxyfactory.factory_class" value="NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle" />
<add key="connection.connection_string" value="UID=sa;Password=sa;Initial Catalog=ARDemo;Data Source=." />
</config>
</activerecord> ide

相關文章
相關標籤/搜索