发现同一依赖程序集的不同版本之间存在冲突 [英] Found conflicts between different versions of the same dependent assembly

查看:21
本文介绍了发现同一依赖程序集的不同版本之间存在冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 .net 3.5 框架和 Microsoft interops 在 Visual Studio 中编写程序,以便与办公产品进行交互.我的 app.config 文件有问题.每次我编译我的解决方案,重建或构建它时,错误列表中都会出现警告

i currently programming a program in visual studio using the .net 3.5 framework and the microsoft interops to interact with the office products. I have an issue with the app.config file. everytime i compile my solution, rebuilt or build it a warning occurs in the error list witch says

发现同一依赖程序集的不同版本之间存在冲突.

Found conflicts between different versions of the same dependent assembly.

当我双击此消息时,visual studio 尝试解决该问题,但在下一次构建时再次出现警告.我检查了 app.config 文件,visual studio 试图解决这个问题,它似乎插入了这些行

when i double click this message visual studio tries to solve the problem, but with the next built the warning occurs again. i checked in the app.config file what visual studio tries to fix the problem and it seems, that it inserts these lines

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="office" publicKeyToken="71E9BCE111E9429C" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
        </dependentAssembly>
        <dependentAssembly>
            <assemblyIdentity name="Microsoft.Vbe.Interop" publicKeyToken="71E9BCE111E9429C" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
        </dependentAssembly>
    </assemblyBinding>
</runtime>

我认为 bindingRedirect 由于版本号而失败,但我无法编辑它们,因为已经解决问题 - 构建 - 出现问题".

i think that the bindingRedirect fails because of the version numbers but i can't edit them, because of the already "solve problem - build - problem occurs" thingy.

有没有人知道可能会出什么问题.我没有任何线索.

does anybody has any idea what might go wrong. i do not have any clue.

感谢每一个想法!

推荐答案

Jinx.我正在研究与 Office 程序集依赖关系的类似问题.就我而言,我需要支持我的 DEV 盒上没有安装的旧版 Office(但安装在构建服务器上).

Jinx. I'm on SO researching a similar issue with dependencies to Office assemblies. In my case, I need to support older Office versions that I don't have installed on my DEV box (but are installed on a build server).

我决定尝试MS Office Wrapper for .Net 开源项目,我在其中一个项目中发现这里的帖子.它声称支持从 97 到 2007 的所有 Office 版本(只要您将自己限制在需要保持兼容的最旧版本中可用的 API 调用).

I decided to try the MS Office Wrapper for .Net open source project I discovered on one of the posts here. It claims to support all versions of Office from 97 to 2007 (as long as you limit yourself to API calls that are available in the oldest version you need to remain compatible with).

也许使用该包装器也可以解决/简化您的 Office 版本依赖性.

Perhaps using that wrapper would solve/simplify your Office version dependency as well.

这篇关于发现同一依赖程序集的不同版本之间存在冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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