[Mono-list] Problem with Fluent NHibernate

Abel Silva abel.silva at gmail.com
Sat Oct 29 14:56:27 EDT 2011


hello

Can you try the following? It's probably a casing problem.

download mysql-connector-net-6.4.4-noinstall.zip
unzip mysql-connector-net-6.4.4-noinstall.zip
cd v4

mv mysql.data.dll MySql.Data.dll
mv mysql.data.entity.dll MySql.Data.Entity.dll
mv mysql.web.dll MySql.Web.dll

mono-2.10 gacutil -i MySql.Data.dll
mono-2.10 gacutil -i MySql.Data.Entity.dll
mono-2.10 gacutil -i MySql.Web.dll

vi /opt/mono-2.10/etc/mono/4.0/machine.config # (or wherever it is located)
* inside section <system.data><DbProviderFactories> add the following:
** <add name="MySQL Data Provider"
invariant="MySql.Data.MySqlClient" description=".Net Framework Data
Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory,
MySql.Data, Version=6.4.4.0, Culture=neutral,
PublicKeyToken=c5687fc88969c44d" />

The last part works for version 6.4.4.

regards
abel

On Sat, Oct 29, 2011 at 19:46, Sharique uddin Ahmed Farooqui <
safknw at gmail.com> wrote:

> Hi,
>
> I'm learning NHibernate, I have build an small application, It is
> working fine under  windows/MS .net. I run the same application under
> mono in Linux, I get the following error. I'm also using Fluent
> Nhibernate in app.
>
> Unhandled Exception:
> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or
> incomplete configuration was used while creating a SessionFactory.
> Check PotentialReasons collection, and InnerException for more detail.
>
>  ---> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or
> incomplete configuration was used while creating a SessionFactory.
> Check PotentialReasons collection, and InnerException for more detail.
>
>  ---> NHibernate.HibernateException: Could not create the driver from
> NHibernate.Driver.MySqlDataDriver, NHibernate, Version=3.1.0.4000,
> Culture=neutral, PublicKeyToken=aa95f207798dfdb4. --->
> System.Reflection.TargetInvocationException: Exception has been thrown
> by the target of an invocation. --->
> System.Configuration.ConfigurationErrorsException: Failed to find or
> load the registered .Net Framework Data Provider
> 'MySql.Data.MySqlClient'.
>  at System.Data.Common.DbProviderFactories.GetFactory (System.String
> providerInvariantName) [0x00000] in <filename unknown>:0
>  at NHibernate.Driver.ReflectionBasedDriver..ctor (System.String
> providerInvariantName, System.String driverAssemblyName, System.String
> connectionTypeName, System.String commandTypeName) [0x00000] in
> <filename unknown>:0
>  at NHibernate.Driver.MySqlDataDriver..ctor () [0x00000] in <filename
> unknown>:0
>  at (wrapper managed-to-native)
> System.Reflection.MonoCMethod:InternalInvoke
> (System.Reflection.MonoCMethod,object,object[],System.Exception&)
>  at System.Reflection.MonoCMethod.Invoke (System.Object obj,
> BindingFlags invokeAttr, System.Reflection.Binder binder,
> System.Object[] parameters, System.Globalization.CultureInfo culture)
> [0x00000] in <filename unknown>:0
>  --- End of inner exception stack trace ---
>  at System.Reflection.MonoCMethod.Invoke (System.Object obj,
> BindingFlags invokeAttr, System.Reflection.Binder binder,
> System.Object[] parameters, System.Globalization.CultureInfo culture)
> [0x00000] in <filename unknown>:0
>  at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr,
> System.Reflection.Binder binder, System.Object[] parameters,
> System.Globalization.CultureInfo culture) [0x00000] in <filename
> unknown>:0
>  at System.Reflection.ConstructorInfo.Invoke (System.Object[]
> parameters) [0x00000] in <filename unknown>:0
>  at System.Activator.CreateInstance (System.Type type, Boolean
> nonPublic) [0x00000] in <filename unknown>:0
>  at System.Activator.CreateInstance (System.Type type) [0x00000] in
> <filename unknown>:0
>  at NHibernate.Bytecode.ActivatorObjectsFactory.CreateInstance
> (System.Type type) [0x00000] in <filename unknown>:0
>  at NHibernate.Connection.ConnectionProvider.ConfigureDriver
> (IDictionary`2 settings) [0x00000] in <filename unknown>:0
>  --- End of inner exception stack trace ---
>  at NHibernate.Connection.ConnectionProvider.ConfigureDriver
> (IDictionary`2 settings) [0x00000] in <filename unknown>:0
>  at NHibernate.Connection.ConnectionProvider.Configure (IDictionary`2
> settings) [0x00000] in <filename unknown>:0
>  at NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider
> (IDictionary`2 settings) [0x00000] in <filename unknown>:0
>  at NHibernate.Tool.hbm2ddl.SchemaExport.Execute (System.Action`1
> scriptAction, Boolean export, Boolean justDrop) [0x00000] in <filename
> unknown>:0
>  --- End of inner exception stack trace ---
>  at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration ()
> [0x00000] in <filename unknown>:0
>  at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory ()
> [0x00000] in <filename unknown>:0
>
>
>  --- End of inner exception stack trace ---
>  at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory ()
> [0x00000] in <filename unknown>:0
>  at NHTest.Data.NHHelper.CreateSessionFactory () [0x00000] in
> <filename unknown>:0
>  at NHTest.Data.NHHelper..ctor () [0x00000] in <filename unknown>:0
>  at NHTest2.MainClass.Main (System.String[] args) [0x00000] in
> <filename unknown>:0
>
>
> [ERROR] FATAL UNHANDLED EXCEPTION:
> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or
> incomplete configuration was used while creating a SessionFactory.
> Check PotentialReasons collection, and InnerException for more detail.
>
>  ---> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or
> incomplete configuration was used while creating a SessionFactory.
> Check PotentialReasons collection, and InnerException for more detail.
>
>  ---> NHibernate.HibernateException: Could not create the driver from
> NHibernate.Driver.MySqlDataDriver, NHibernate, Version=3.1.0.4000,
> Culture=neutral, PublicKeyToken=aa95f207798dfdb4. --->
> System.Reflection.TargetInvocationException: Exception has been thrown
> by the target of an invocation. --->
> System.Configuration.ConfigurationErrorsException: Failed to find or
> load the registered .Net Framework Data Provider
> 'MySql.Data.MySqlClient'.
>  at System.Data.Common.DbProviderFactories.GetFactory (System.String
> providerInvariantName) [0x00000] in <filename unknown>:0
>  at NHibernate.Driver.ReflectionBasedDriver..ctor (System.String
> providerInvariantName, System.String driverAssemblyName, System.String
> connectionTypeName, System.String commandTypeName) [0x00000] in
> <filename unknown>:0
>  at NHibernate.Driver.MySqlDataDriver..ctor () [0x00000] in <filename
> unknown>:0
>  at (wrapper managed-to-native)
> System.Reflection.MonoCMethod:InternalInvoke
> (System.Reflection.MonoCMethod,object,object[],System.Exception&)
>  at System.Reflection.MonoCMethod.Invoke (System.Object obj,
> BindingFlags invokeAttr, System.Reflection.Binder binder,
> System.Object[] parameters, System.Globalization.CultureInfo culture)
> [0x00000] in <filename unknown>:0
>  --- End of inner exception stack trace ---
>  at System.Reflection.MonoCMethod.Invoke (System.Object obj,
> BindingFlags invokeAttr, System.Reflection.Binder binder,
> System.Object[] parameters, System.Globalization.CultureInfo culture)
> [0x00000] in <filename unknown>:0
>  at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr,
> System.Reflection.Binder binder, System.Object[] parameters,
> System.Globalization.CultureInfo culture) [0x00000] in <filename
> unknown>:0
>  at System.Reflection.ConstructorInfo.Invoke (System.Object[]
> parameters) [0x00000] in <filename unknown>:0
>  at System.Activator.CreateInstance (System.Type type, Boolean
> nonPublic) [0x00000] in <filename unknown>:0
>  at System.Activator.CreateInstance (System.Type type) [0x00000] in
> <filename unknown>:0
>  at NHibernate.Bytecode.ActivatorObjectsFactory.CreateInstance
> (System.Type type) [0x00000] in <filename unknown>:0
>  at NHibernate.Connection.ConnectionProvider.ConfigureDriver
> (IDictionary`2 settings) [0x00000] in <filename unknown>:0
>  --- End of inner exception stack trace ---
>  at NHibernate.Connection.ConnectionProvider.ConfigureDriver
> (IDictionary`2 settings) [0x00000] in <filename unknown>:0
>  at NHibernate.Connection.ConnectionProvider.Configure (IDictionary`2
> settings) [0x00000] in <filename unknown>:0
>  at NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider
> (IDictionary`2 settings) [0x00000] in <filename unknown>:0
>  at NHibernate.Tool.hbm2ddl.SchemaExport.Execute (System.Action`1
> scriptAction, Boolean export, Boolean justDrop) [0x00000] in <filename
> unknown>:0
>  --- End of inner exception stack trace ---
>  at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration ()
> [0x00000] in <filename unknown>:0
>  at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory ()
> [0x00000] in <filename unknown>:0
>
>
>  --- End of inner exception stack trace ---
>  at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory ()
> [0x00000] in <filename unknown>:0
>  at NHTest.Data.NHHelper.CreateSessionFactory () [0x00000] in
> <filename unknown>:0
>  at NHTest.Data.NHHelper..ctor () [0x00000] in <filename unknown>:0
>  at NHTest2.MainClass.Main (System.String[] args) [0x00000] in
> <filename unknown>:0
>
> --
> Sharique uddin Ahmed Farooqui
> http://safknw.blogspot.com/
> "Peace" is the Ultimate desire of mankind.
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>



-- 
Abel Silva

abel.silva at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20111029/73509b86/attachment-0001.html 


More information about the Mono-list mailing list