两个不同的程序集版本"找到的程序集清单定义不匹配的程序集引用" [英] Two different assembly versions "The located assembly's manifest definition does not match the assembly reference"

查看:254
本文介绍了两个不同的程序集版本"找到的程序集清单定义不匹配的程序集引用"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我就这一工作的一个项目需要使用MySQL连接器为NHibernate的,(Mysql.Data.dll)的。我也想引用在同一项目中的另一个项目(Migrator.NET)。问题是,即使Migrator.NET与参考MySql.Data与特定版本= FALSE建成,它仍然试图引用MySql.Data的旧版本,该库是使用,而不是只使用有版本内置..和我得到​​的标题中列出的除外:

I have a project that I am working on that requires the use of the Mysql Connector for NHibernate, (Mysql.Data.dll). I also want to reference another project (Migrator.NET) in the same project. The problem is even though Migrator.NET is built with the reference to MySql.Data with specific version = false, it still tries to reference the older version of MySql.Data that the library was built with instead of just using the version that is there.. and I get the exception listed in the title:

----> System.IO.FileLoadException:无法加载文件或程序装配
'MySql.Data,版本= 1.0.10.1,
区域性=中性,
公钥= c5687fc88969c44d'或
它的一个依赖。在位于
集清单定义做
不匹配程序集引用。
(从HRESULT异常:0x80131040)

----> System.IO.FileLoadException : Could not load file or assembly 'MySql.Data, Version=1.0.10.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

我在主组件引用的版本是6.1.3.0。我如何获得这两个组件进行合作

The version I am referencing in the main assembly is 6.1.3.0. How do I get the two assemblies to cooperate?

编辑:

有关那些你指定的程序集绑定重定向,我已经设置为:

For those of you specifying Assembly Binding Redirection, I have set this up:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-6.1.3.0" newVersion="6.1.3.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>



我引用这个主部件在另一个项目,并仍然得到同样的错误。如果我的主组件被复制到本地的其他组件一起使用,将它的app.config使用的设置或执行此信息都将包含在每个应用程序或程序集引用我的主要部件?

I am referencing this the main assembly in another project and still getting the same errors. If my main assembly is copied local to be used in the other assembly, will it use the settings in app.config or does this information have to be included with every application or assembly that references my main assembly?

推荐答案

这是一个相当总值版本不匹配。 bindingRedirect是没有什么帮助的时候的版本相差这么多。你听错了顺便说一句,你想要NEWVERSION来匹配​​被发现之一。但是,不要去那里。

That's a pretty gross version mismatch. bindingRedirect is not going to help when the versions differ so much. You got it wrong btw, you'd want newVersion to match the one that was found. But don't go there.

综观Migrator.NET下载,我想我看到的问题。 lib文件夹包含的真正的旧版本MySql.Data.dll的,它是为了在.NET 1.0中运行。通过轰击它启动,并尝试与该程序集的版本6重建。祝你好运,我想你会需要它。

Looking at the Migrator.NET download, I think I see the problem. The lib folder contains a really old version of MySql.Data.dll, it was made to run on .NET 1.0. Start by zapping it and try to rebuild with version 6 of that assembly. Good luck, I think you'll need it.

这篇关于两个不同的程序集版本&QUOT;找到的程序集清单定义不匹配的程序集引用&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆