views:

493

answers:

2

I have been looking into Fluent Nhibernate, and it seems really promising. But...

I can't seem to get it working with a MySQL database. I have the Fluent Nhibernate example project running fine with the SQLite database (Fluent NHibernate: Getting Started), but as soon as I change the database configuration to this:

            return Fluently.Configure()
            .Database(MySQLConfiguration.Standard.ConnectionString(
                x => x.Database("database")
                    .Server("server")
                    .Username("login")
                    .Password("password")
                )
                )
            .Mappings(m =>
                m.FluentMappings.AddFromAssemblyOf<Program>())
            .ExposeConfiguration(BuildSchema)
            .BuildSessionFactory();

I get a strange exception:

Value cannot be null. Parameter name: stream

I know that I can connect to the MySQL with a simple SQL statement from the same project.

Any ideas? :)

A: 

Does your schema exist? Because your using .ExposeConfiguration(BuildSchema) to "build" it?

Henrik
Yes, it does exist (I had missed that line). Without it, I get the same error.I tried making it simpler, with a single table/object mapping without foreign keys, but I still get the same error.
Mogens Kraus
A: 

I get the same error, have someone found a solution? Thanks.

Imesh