C# dll绑定到不同版本
我刚刚重新启动了一个使用 NHibernate 的项目。我上次使用该项目时运行良好,但现在出现以下错误。
System.IO.FileLoadException:无法加载文件或程序集 'Iesi.Collections,版本=1.0.0.3,文化=中性, PublicKeyToken=aa95f207798dfdb4' 或其依赖项之一。这 找到的程序集的清单定义与程序集不匹配 参考。 (HRESULT 异常:0x80131040) NHibernate.Cfg.Configuration.Reset() 在 NHibernate.Cfg.Configuration..ctor(SettingsFactory settingsFactory) at NHibernate.Cfg.Configuration..ctor() 位于 Luther.Dao.Repositories.Session.NHibernateHelper..cctor() 中 NHibernateHelper.cs:第 18 行
我注意到当前对 iesi.dll 的引用位于 1.0.1.0。 让它重新启动并运行的最佳方法是什么?尝试找到合适版本的dll或整理清单文件?
I have just restarted a project in which I am using NHibernate. The project worked fine last time I used it but now is giving the following error.
System.IO.FileLoadException: Could not load file or assembly
'Iesi.Collections, Version=1.0.0.3, 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) at
NHibernate.Cfg.Configuration.Reset() at
NHibernate.Cfg.Configuration..ctor(SettingsFactory settingsFactory) at
NHibernate.Cfg.Configuration..ctor() at
Luther.Dao.Repositories.Session.NHibernateHelper..cctor() in
NHibernateHelper.cs: line 18
I notice the current reference to the iesi.dll is at 1.0.1.0.
What is the best way to get this up and running again? Try and find the appropriate version of the dll or sort out the manifest file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
自上次运行此应用程序以来,您是否更新了项目中的某个程序集?看起来 NHibernate 是针对版本 1.0.0.3 构建的,而您当前拥有 1.0.1.0。
您应该能够在 App.config 中使用 BindingRedirect 元素(或 web.config,视情况而定)指示 .Net Framework 满足不同版本的依赖关系。像这样的东西
Have you updated one of the assemblies in your project since the last time this app ran for you? It looks like NHibernate was built against version 1.0.0.3, and you currently have 1.0.1.0.
You should be able to use a BindingRedirect element in your App.config (or web.config, as appropriate) to instruct the .Net Framework to satisfy the dependency with a different version. Something like