How to get Fluent NHibernate working with NHiberna

2019-03-10 14:36发布

问题:

How to get Fluent NHibernate working with latest NHibernate 3.x trunk

I got the following Exception :

Could not load file or assembly 'NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies.

EDIT :

This exception occurs in FluentNhibernate file PersistanceConfiguration

    public TThisConfiguration Cache(Action<CacheSettingsBuilder> cacheExpression)
    {
        cacheExpression(cache);
        return (TThisConfiguration)this;
    }

Don't understand, FluentNHibernate is well compiled against NH 3.x

回答1:

The FluentNHibernate download page has stable pre-release (pre 1.2) binaries for NHibernate 3.0 and 2.1.2



回答2:

Fluent just posted pre-release binaries (v1.2) with NH3 support. No need to recompile its sources.



回答3:

I'd grab it from github:

https://github.com/dagda1/horn_src

this will include all of the dependancies also so you don't need to mess about with compiling all the projects and their dependancies :)