ERROR: The IDbCommand and IDbConnection implementation in the assembly MySql.Data could not be found
Hy guys. How I resolve this problem? Im gettin the error message:
The IDbCommand and IDbConnection implementation in the assembly MySql.Data could not be found. Ensure that the assembly MySql.Data is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use element in the application configuration file to specify the full name of the assembly.
So, I added this lines to web.config:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<qualifyAssembly partialName="MySql.Data" fullName="MySql.Data, Version=6.3.6, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</assemblyBinding>
</runtime>
But didn't worked.
This is the method who configures the Hibernate:
private static ISessionFactory CreateSessionFactory()
{
开发者_开发技巧 return new NHibernate.Cfg.Configuration()
.Configure( @"C:\Users\Documents\Visual Studio 2010\Projects\Atendimento\NHibernateLayer\hibernate.cfg.xml" )
.AddAssembly( typeof( NHibernateHelper ).Assembly )
.BuildSessionFactory();
}
Anyone??? Tkhs!!!
I remember seeing this error message before, and the solution that worked for me (if memory serves!) was found in this blog entry.
You appear to be adding the appropriate line to your web.config
, however have you verified that you're setting the correct version number / public key token?
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<qualifyAssembly partialName="MySql.Data"
fullName="MySql.Data, Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
</qualifyAssembly>
</assemblyBinding>
</runtime>
That said - I've seen strange/confusing things happen when there's Version N
of the MySql.Data assembly in the GAC and you have another copy that you're referencing that's Version M
. Make sure that you're referencing the same version in your project as is the version in the GAC.
精彩评论