开发者

FluentNHibernate and NuGet, problem with NH version

I just updated my project to use NuGet for external references. I added reference to NHibernate, which added all other dependencies for NH. Than I added FluentNHibernate. Versions of NH downloaded for NH and Fluent do not match. NuGet shows version of FNH as 1.1.1.694 as dependent on NH version 3.0.0.0.2001, while NH is showing as version 3.0.0.4000.

When I run the app, I get this message:

Could not load file or assembly 'NHibernate, Version=3.0.0.2001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I also tried downloading from FNH site, but that shows that is ve开发者_如何学Gorsion on FNH is 1.1.0.685 which is dependent on 2.1.2.4000.

Can you fix the NuGet, or should I just use BindingRedirect in config?


You're in luck! NuGet has a command for just this scenario (which we plan to make more automatic in the future http://blog.davidebbo.com/2011/01/nuget-versioning-part-3-unification-via.html). First build your project and from the package manager console type:

PM> Add-BindingRedirect

And it will add the minimal set of binding redirects to config to get everything working.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜