Hi there,
I'm in the throws of converting an MSSQL project to MySQL, and wanted to switch over my NHibernate configuration files. I'm getting the following error when I try to run my tests (note that DataAccess.NHSession is just a simple "helper" class, it's not been any trouble so far):
Code:
NMI.UnitTests.NHibernateDataAccessTests.TestSetup : System.TypeInitializationException : The type initializer for "NMI.Utility.DataAccess.NHSession" threw an exception.
----> NHibernate.HibernateException : Could not create the driver from NHibernate.Driver.MySqlDataDriver.
----> System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
----> NHibernate.HibernateException : The IDbCommand and IDbConnection implementation in the Assembly MySql.Data could not be found. Please ensure that the Assemblies MySql.Data.dll and ICSharpCode.SharpZipLib.dll are in the Global Assembly Cache or in a location that NHibernate can use System.Type.GetType(string) to load the types from.
The steps I've taken are:
- Updated project to use latest NHibernate release (0.8.4)
- Downloaded the ByteFX drivers from
http://sourceforge.net/projects/mysqlnet/- Downloaded the latest SharpZipLib
Referenced all these from my project (not sure if this is needed).
I've also updated my config files to have the following settings
Code:
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="hibernate.dialect" value="NHibernate.Dialect.MySQLDialect" />
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.MySqlDataDriver" />
<add key="hibernate.connection.connection_string" value="server=(local); user id=root; password=xxxxx; database=nmi_indexer; pooling=false;" />
Is there anything I'm missing here?
Any help much appreciated.
Tobin
P.S - I also scanned the docs, examples and FAQ for any MySql examples. Didn't see any in there.