12

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

Yoann. B
  • 11,075
  • 19
  • 69
  • 111

3 Answers3

11

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

Lachlan Roche
  • 25,678
  • 5
  • 79
  • 77
  • 1
    @Lachlan : I already did ... but still assembly load exception. I'm using it on an ASP.NET MVC web site. Maybe i need to clear ASP.NET temporary files ? – Yoann. B Feb 28 '10 at 16:21
  • @Lachlan : cleared asp.net temporary files, exception still here – Yoann. B Feb 28 '10 at 16:26
  • @Yoann Check the references of your fluent dll in reflector. If this shows NH 3.x, then something else is trying to load 2.1 - possibly from a web.config entry. – Lachlan Roche Feb 28 '10 at 16:29
  • @Lachlan : References in FluentNhib are NH 3.x, however execption thrown into FluentNHibernate.cfg.Db.PersistenceConfirguration at line 190 public TThisConfiguration Cache(Action cacheExpression) { cacheExpression(cache); return (TThisConfiguration)this; } – Yoann. B Feb 28 '10 at 16:34
  • @Yoann I think you might have a NH cache provider from NH2.1 – Lachlan Roche Feb 28 '10 at 16:38
  • @Lachlan : You right ! Now i' getting exception from NHibernate.Search, i'm going to rebuild it against NH 3.x. Thanks. – Yoann. B Feb 28 '10 at 16:44
7

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

Restuta
  • 5,855
  • 33
  • 44
2

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

woot
  • 7,406
  • 2
  • 36
  • 55
  • you can still download the code from google code and run it locally - it was never just about the website :) but there are also now alternatives - openwrap for one... –  Nov 22 '10 at 16:59