title: [A]MySql.Data.MySqlClient.MySqlConnection cannot be cast to [B]MySql.Data.MySqlClient.MySqlConnection
body: <p>I am getting this strange inexplicable error when I uploaded my application to a server for testing. From what I studied, it seems to be caused by conflicting MySql.Data, the copy I uploaded belongs to: 6.3.7.0.</p>
  
  <p>How could I solve this issue? I thought just putting it in the bin would 'override' the one in GAC?</p>
  
  <p>NHibernate.Exceptions.GenericADOException: could not execute query [ SELECT this_.Id as Id18_0_, this_.Email as Email18_0_,</p>
  
  <p>(etc properties)</p>
  
  <p>FROM <code>User</code> this_ WHERE this_.Email = ? and this_.Password = ? ] Positional parameters: #0>WvewHQlNRyQNKjBAtPR1AwrWQj0nwfmIflO+r4mCJQWA1jZ9zRvefcGz6ZA69b3v #1>97403BA77F7C26BEC6B4F0A4F8509E02848CCD7DCF61D7DF5D79C3AAB2760E6AE1EB26F5D10D384E069F8C6089C47D3F1F0F17E7EBF30F71A68A39DF8863646F </p>
  
  <p>[SQL: SELECT this_.Id as Id18_0_, this_.Email as Email18_0_, </p>
  
  <p>(etc properties)</p>
  
  <p>FROM <code>User</code> this_ WHERE this_.Email = ? and this_.Password = ?] ---> </p>
  
  <p>System.InvalidCastException: [A]MySql.Data.MySqlClient.MySqlConnection cannot be cast to [B]MySql.Data.MySqlClient.MySqlConnection. Type A originates from 'MySql.Data, Version=6.2.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' in the context 'Default' at location 'C:\Windows\assembly\GAC_MSIL\MySql.Data\6.2.3.0__c5687fc88969c44d\MySql.Data.dll'. Type B originates from 'MySql.Data, Version=6.3.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' in the context 'Default' at location 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\cb584441\17e039bb\assembly\dl3\6b14fe89\804a4095_b2c0cc01\MySql.Data.DLL'. </p>
  
  <p>at MySql.Data.MySqlClient.MySqlCommand.set_DbConnection(DbConnection value) at System.Data.Common.DbCommand.System.Data.IDbCommand.set_Connection(IDbConnection value) at NHibernate.AdoNet.AbstractBatcher.Prepare(IDbCommand cmd) at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd) at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session) at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) --- End of inner exception stack trace --- at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet<code>1 querySpaces, IType[] resultTypes) at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results) at NHibernate.Impl.CriteriaImpl.List(IList results) at NHibernate.Impl.CriteriaImpl.UniqueResult[T]() at NHibernate.Criterion.QueryOver</code>1.SingleOrDefault() at NHibernate.Criterion.QueryOver`1.NHibernate.IQueryOver.SingleOrDefault()</p>