i see when i install fluent nhibernate 1.2 from Nuget, it downloads nhibernate 3.1. If i want to use nhibernate 3.2, how would i do that through nuget and it is compatible with fluent nhibernate 1.2 ?
-
Currently FluentNHibernate 1.3 on NuGet is built against 3.2 – mxmissile Sep 08 '11 at 15:48
3 Answers
If you use the Nuget Package Manager Console instead of the GUI to get the package (Install-Package FluentNHibernate) you will get version 1.3.0.717 which is compatible with NHibernate 3.2
I tried it and is working fine for me.

- 2,319
- 1
- 20
- 23
-
This is better than the original accepted answer. FNH 1.3 appears to have no dependancy on NHibernate.Castle. Then again, 1.3 is not the current stable release, so use at your own risk. – Matt Johnson-Pint Nov 01 '11 at 13:52
-
3Awesome answer. Does anyone know why the NuGet Console behaves differently and gives different results than the GUI? – Asbjørn Ulsberg Jan 11 '12 at 18:44
-
Remarkably (although I didn't believe it would) this also worked for me! +1 – reach4thelasers Feb 19 '12 at 15:05
-
@Ajadex where can I get version 1.3, official git branch has only 1.2 build. – Johnny_D Apr 18 '12 at 15:01
-
@Johnny_D I downloaded it using Nuget, I don't know any other way of doing it. I suspect version 1.3 was only created with the purpose of support NHibernate 3.2. – Ajadex Apr 18 '12 at 16:10
-
@Ajadex I've just checked, version 1.3 and 1.2 were released at one day, besides git doesn't has any download consisting 1.3 release number. And it almost a yeas since last update. Does it mean that this project isn't supported any more? – Johnny_D Apr 19 '12 at 06:56
Here you can read about plans to release FluentNHibernate for 3.2GA soon and a suggested workaround using attributes
http://groups.google.com/group/fluent-nhibernate/browse_thread/thread/8e782e45ed9ba647
I got my working using
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NHibernate"
publicKeyToken="aa95f207798dfdb4"
culture="neutral" />
<bindingRedirect oldVersion="3.1.0.4000"
newVersion="3.2.0.4000"/>
</dependentAssembly>
</assemblyBinding>

- 11,703
- 7
- 56
- 93
Currently, the FluentNHibernate package from the offical NuGet package source, depends on NHibernate.Castle 3.1 (currently, there is no newer version yet), which in turn depends on NHibernate 3.1 (the exact version, not 3.1 or higher). Therefore, NuGet infers a dependency on NHibernate 3.1 when installing FluentNHibernate.
So the bottom line is: you can't, until the FluentNHibernate package is updated.
The most practical way around is getting the latest FluentNHibernate source code and building it against NHibernate 3.2. I've tested that and it seems to work just fine. You might even be fine using assembly binding redirects, but I haven't tested that.
Alternatively, you can wait for NHibernate 3.2 to reach GA (final) and FluentNHibernate to catch up, but of course that's not a very satisfying answer.

- 6,310
- 5
- 37
- 80