Failed to create driver from NHibernate.Driver.MySqlDataDriver

I used this code in the hibernate.cfg.xml configuration:

<?xml version="1.0"?> <hibernate-configuration xmlns= "urn:nhibernate-configuration-2.2"> <session-factory> <!-- SQLServer: Provider --><!-- <property name="connection.provider"> NHibernate.Connection.DriverConnectionProvider </property>--> <!-- SQLServer: Driver --> <property name="connection.driver_class"> NHibernate.Driver.MySqlDataDriver </property> <!-- SQLServer: Dialeto --> <property name="dialect"> NHibernate.Dialect.MySQLDialect </property> <!-- SQLServer: Connection String --> <property name="connection.connection_string"> Database=nhibernate;Data Source=localhost;User Id=root;Password=xxxx</property> <!-- Classe que serΓ‘ utilizada para Proxy (LazyLoading) --> <property name="proxyfactory.factory_class"> NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu </property> </session-factory> </hibernate-configuration> 

I have a problem creating a database.

NHibernate.HibernateException: Failed to create driver from NHibernate.Driver.MySqlDataDriver. ---> System.Reflection.TargetInvocationException: An exception was thrown by the target of the call. ---> NHibernate.HibernateException: implementation of IDbCommand and IDbConnection in assembly MySql.Data not found ....

What should I do?

+8
mysql nhibernate
source share
1 answer

It is simple: add Mysql.Data.dll to the bin folder of the project.

+23
source share

Source: https://habr.com/ru/post/649754/


All Articles