我目前使用 .net 3.5 框架和 microsoft interops 在 Visual Studio 中编写一个程序来与 Office 产品交互。
我的 app.config 文件有问题。每次我编译我的解决方案、重建或构建它时,错误列表中都会出现警告,女巫说
发现同一依赖程序集的不同版本之间存在冲突。
当我双击此消息时,Visual Studio 尝试解决该问题,但在构建下一个版本时,警告再次出现。我在 app.config 文件中检查了 Visual Studio 试图解决问题的内容,看起来它插入了这些行
<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>
我认为绑定重定向因版本号而失败,但我无法编辑它们,因为已经“解决问题 - 构建 - 问题发生”。
有人知道会出什么问题吗?我没有任何线索。
感谢您的每一个想法!
金克斯。我正在研究与 Office 程序集依赖关系类似的问题。就我而言,我需要支持尚未安装在开发盒上(但安装在构建服务器上)的旧版 Office。
我决定尝试一下.Net 的 MS Office 包装器 http://www.codeplex.com/msofficefornet我在这里的一篇文章中发现了开源项目。它声称支持从 97 到 2007 的所有 Office 版本(只要您将自己限制为您需要保持兼容的最旧版本中可用的 API 调用)。
也许使用该包装器也可以解决/简化您的 Office 版本依赖性。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)