使用MySQL8Dialect配置Nhibernate 5.3.8



我在c#应用程序中更新了NHibernate版本和MysqlData版本

版本信息

NHibernate 5.3.8
MySqlData 8.0.24.0

在我的hibernate_mysql_config.xml下方

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory name="hsms.local">
<property name="connection.driver_class">
NHibernate.Driver.MySqlDataDriver
</property>
<property name="connection.connection_string">
data source=xxxxxx;Database=xxxxxx; User ID=xxxxxxx;Password=xxxxxxxxx;default command timeout=5000; Convert Zero Datetime=true; Allow Zero Datetime=True;
</property>
<property name="adonet.batch_size">
200
</property>
<property name="show_sql">
false
</property>
<property name="connection.isolation">
ReadCommitted
</property>
<property name="dialect">
NHibernate.Dialect.MySQL8Dialect
</property>
<property name="command_timeout">
60
</property>
<property name="query.substitutions">
true 1, false 0, yes 'Y', no 'N'
</property>
<property name="cache.use_second_level_cache">true</property>
<property name="cache.use_query_cache">true</property>
<mapping assembly="Merqurio.Redazione.DL.Model" />
</session-factory>
</hibernate-configuration>

当我运行应用程序时,我会出现以下错误:

无法加载类型NHibernate。地方话MySQL8对话框。可能的原因:未指定程序集名称":"quot

堆栈下方跟踪:

at NHibernate.Dialect.Dialect.InstantiateDialect(String dialectName, IDictionary 2 props)
at NHibernate.Dialect.Dialect.GetDialect(IDictionary 2 props)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at Merqurio.Redazione.DAL.Persistance.SessionManagerMySqlDottNet..cctor() in E:ProgettiProgetti C# Visual StudioRedazionetrunkMerqurio.RedazioneMerqurio.Redazione.DAL.PersistenceSessionManagerMySqlDottNet.cs:line 71

我已经查过方言拼写了。怎么了?

在配置文件中添加以下行

<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>

相关内容

  • 没有找到相关文章

最新更新