FluentNHibernate 和 NuGet,NH 版本问题
我刚刚更新了我的项目以使用 NuGet 进行外部引用。我添加了对 NHibernate 的引用,它添加了 NH 的所有其他依赖项。然后我添加了 FluentNHibernate。为 NH 和 Fluent 下载的 NH 版本不匹配。 NuGet 将 FNH 的版本显示为 1.1.1.694,因为它依赖于 NH 版本 3.0.0.0.2001,而 NH 显示为版本 3.0.0.4000。
当我运行该应用程序时,我收到以下消息:
无法加载文件或程序集“NHibernate,Version=3.0.0.2001,Culture=neutral,PublicKeyToken=aa95f207798dfdb4”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。 (HRESULT 异常:0x80131040)
我也尝试从 FNH 网站下载,但这表明 FNH 上的版本是 1.1.0.685,它依赖于 2.1.2.4000。
您可以修复 NuGet,还是我应该在配置中使用 BindingRedirect?
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 version 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你很幸运! NuGet 有一个专门针对这种情况的命令(我们计划在将来使其更加自动化 http://blog.davidebbo.com/2011/01/nuget-versioning-part-3-unification-via.html)。首先构建您的项目,然后从包管理器控制台输入:
它会将最小的绑定重定向集添加到配置以使一切正常工作。
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:
And it will add the minimal set of binding redirects to config to get everything working.