Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6754293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:15:45+00:00 2026-05-26T13:15:45+00:00

I have created an small application, in which I’m using Fluent Nhibernate. Application run

  • 0

I have created an small application, in which I’m using Fluent Nhibernate. Application run fine on windows but give the exception in Mono.

    ---> 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 

I’m using Kubuntu 11.10 and Mono 2.10.5. Fluent NHibernate version is 1.2. Is Fluent NHibernate is not fully supported under Mono?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:15:45+00:00Added an answer on May 26, 2026 at 1:15 pm

    From my experience, Fluent NHibernate works fine on Mono.

    I actually just got this working yesterday. Unfortunately, I don’t have my code in front of me, but I’ll give you some tips until I can post working code…

    I assume you’ve downloaded the MySql.Data.dll and referenced it in your Mono project. Something to watch out for is that this file is usually called MySQL.Data.dll after download. It should be renamed to MySql.Data.dll (notice the case change on the ‘Q‘ and ‘L‘).

    The library then has to be registered in the GAC to work with Mono. Simply placing the file in a relative path and referencing it doesn’t work (I’m not completely sure why). More info is here.

    gacutil /i MySql.Data.dll
    

    If it still doesn’t work, you may need to write a driver that descends from NHibernate.Driver.ReflectionBasedDriver. It’s a very small piece of code that I’ll post later when I can get to it.

    Edit: Here’s the MySQL driver I’m using.

    public class MySqlDriver : NHibernate.Driver.ReflectionBasedDriver
    {
        public MySqlDriver() : base(
            "MySql.Data, Version=6.4.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d",
            "MySql.Data.MySqlClient.MySqlConnection, MySql.Data, Version=6.4.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d",
            "MySql.Data.MySqlClient.MySqlCommand, MySql.Data, Version=6.4.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
        ) { }
    
        public override bool UseNamedPrefixInParameter
        {
            get { return true; }
        }
    
        public override bool UseNamedPrefixInSql
        {
            get { return true; }
        }
    
        public override string NamedPrefix
        {
            get { return "@"; }
        }
    
        public override bool SupportsMultipleOpenReaders
        {
            get { return false; }
        }
    }
    

    …and the session factory functions

    private string _ConnectionString = "";
    
    private ISessionFactory CreateSessionFactory()
    {
        return Fluently.Configure().Database(
            MySQLConfiguration.Standard.Driver<MySqlDriver>().ConnectionString(_ConnectionString)
        ).Mappings(
            m => m.FluentMappings.AddFromAssemblyOf<YourType>()
        ).ExposeConfiguration(
            BuildSchema
        ).BuildSessionFactory();
    }
    
    private void BuildSchema(Configuration config)
    {
        //new SchemaExport(config).Create(false, true);
        new SchemaUpdate(config).Execute(false, true);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small application which I created using jeweler. The jeweler generates a
I have created a small application which opens,reads and creates Excel files. The app
I want to globalize my application. I have created a small form which asks
I have created a small application using Microsoft .NET. I don't have problems with
I have created small test web application which makes use of LINQ to SQL.
I have created a small Java application in which there is some code that
I have created a small chatting application in C#, and started as a Console
hello all I have a small dialog which I created dynamically, which has a
I have created a use case of a small application and now I have
I have created an application in which i have to add users to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.