当我将应用程序上传到服务器进行测试时,我收到了这个奇怪的莫名其妙的错误。从我研究来看,似乎是MySql.Data冲突造成的,我上传的副本属于:6.3.7.0。
我该如何解决这个问题?我认为将它放入垃圾箱会“覆盖” GAC 中的垃圾箱?
NHibernate.Exceptions.GenericADOException: 无法执行查询 [ SELECT this_.Id as Id18_0_, this_.Email as Email18_0_,
(等属性)
FROM User
this_ WHERE this_.Email = ? 和 this_.Password = ? ] Positional parameters: #0>WvewHQlNRyQNKjBAtPR1AwrWQj0nwfmIflO+r4mCJQWA1jZ9zRvefcGz6ZA69b3v #1>97403BA77F7C26BEC6B4F0A4F8509E02848CCD7DCF61D7DF5D79C3AAB2760E6AE1EB26F5D10D384E069F8C6089C47D3F1F0F17E7EBF30F71A68A39DF8863646F
[SQL: 选择 this_.Id 作为 Id18_0_,this_.Email 作为 Email18_0_,
(等属性)
FROM User
this_ WHERE this_.Email = ? 而 this_.Password = ?] --->
System.InvalidCastException:[A]MySql.Data.MySqlClient.MySqlConnection 无法转换为 [B]MySql.Data.MySqlClient.MySqlConnection。类型 A 源自 'MySql.Data, Version=6.2.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' 在位置 'C:\Windows\assembly\GAC_MSIL\MySql.Data\6.2.3.0__c5687fc88969c44d\ MySql.Data.dll'。类型 B 源自 'MySql.Data, Version=6.3.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' 在位置 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP 的上下文'Default'中。 NET 文件\root\cb584441\17e039bb\assembly\dl3\6b14fe89\804a4095_b2c0cc01\MySql.Data.DLL'。
在 MySql.Data.MySqlClient.MySqlCommand.set_DbConnection(DbConnection 值) 在 NHibernate.AdoNet.AbstractBatcher.Prepare(IDbCommand cmd) 在 NHibernate.AdoNet System.Data.Common.DbCommand.System.Data.IDbCommand.set_Connection(IDbConnection 值) .AbstractBatcher.ExecuteReader(IDbCommand cmd) 在 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)在 NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) 在 NHibernate.Loader.Loader.DoList(ISessionImplementor session,QueryParameters queryParameters) --- 内部异常堆栈跟踪的结束 --- 在 NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) 在 NHibernate.Loader 的 NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)。 Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet1 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
NHibernate.Criterion.QueryOver`1.NHibernate.IQueryOver.SingleOrDefault() 处的 1.SingleOrDefault()