The IDbCommand and IDbConnection ... MySql.Data could not be found エラーについて
2009/12/10 13:31Update
The IDbCommand and IDbConnection implementation in the assembly MySql.Data could not be found エラーの原因と対処方法について
現象
NHibernate初期化時以下のような例外が発生してしまいます。
例外の詳細:
NHibernate.HibernateException: 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 <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly.
スタック トレース:
[HibernateException: 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 <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly.]
NHibernate.Driver.ReflectionBasedDriver..ctor(String driverAssemblyName, String connectionTypeName, String commandTypeName) +225
NHibernate.Driver.MySqlDataDriver..ctor() +47
[TargetInvocationException: 呼び出しのターゲットが例外をスローしました。]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
System.Activator.CreateInstance(Type type) +6
NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2 settings) +172
[HibernateException: Could not create the driver from NHibernate.Driver.MySqlDataDriver.]
NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2 settings) +319
NHibernate.Connection.ConnectionProvider.Configure(IDictionary`2 settings) +207
NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary`2 settings) +490
NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary`2 properties) +1293
NHibernate.Cfg.Configuration.BuildSettings() +48
NHibernate.Cfg.Configuration.BuildSessionFactory() +206
NHibernate.Driver.ReflectionBasedDriver..ctor(String driverAssemblyName, String connectionTypeName, String commandTypeName) +225
NHibernate.Driver.MySqlDataDriver..ctor() +47
[TargetInvocationException: 呼び出しのターゲットが例外をスローしました。]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
System.Activator.CreateInstance(Type type) +6
NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2 settings) +172
[HibernateException: Could not create the driver from NHibernate.Driver.MySqlDataDriver.]
NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2 settings) +319
NHibernate.Connection.ConnectionProvider.Configure(IDictionary`2 settings) +207
NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary`2 settings) +490
NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary`2 properties) +1293
NHibernate.Cfg.Configuration.BuildSettings() +48
NHibernate.Cfg.Configuration.BuildSessionFactory() +206
対処
アセンブリMySql.Data.dllがBINディレクトリに存在しないため。
MySql.Data.dllをここから
ダウンロードできます。
Sponsored Link
- Relative Articles
- 初めてのNHibernate入門 サンプル - (2009/11/25 17:19)
- NHibernate のインストール&導入 - (2009/11/25 13:03)