which version of fluent nhibernate is compatible with nhibernate 3.2

╄→尐↘猪︶ㄣ 提交于 2019-12-21 03:49:44

问题


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 ?


回答1:


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.




回答2:


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.




回答3:


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>


来源:https://stackoverflow.com/questions/6572788/which-version-of-fluent-nhibernate-is-compatible-with-nhibernate-3-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!