指定 v11(安装了 v11 和 v12)Microsoft.Office.Interop.Word

发布于 2024-09-17 18:55:54 字数 527 浏览 2 评论 0原文

我正在开发一个使用 Microsoft.Office.Interop.Word 的旧版 VB.NET 应用程序,服务器上安装了 Office 2003。

当我发布我的网站时,即使我的配置文件清楚地显示 v11:

该网站将崩溃并提示找不到 v12: 无法加载文件或程序集“Microsoft.Office.Interop.Word,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。 (HRESULT 异常:0x80131040)

注意:我目前有 Office 2003 和 Office 2003。 2007 安装在我的开发机器上,另外,当查看@引用时,我可以选择选择 v11 或 v12(所以 v11 是默认的)。

在网站的一个页面中,该页面执行 Microsoft.Office.Interop.Word 的导入语句。此时是否可以指定版本,或者有什么方法可以强制它使用 v11 而无需卸载 v12?

I am working on a legacy VB.NET application that uses Microsoft.Office.Interop.Word, with Office 2003 installed on the server.

When I publish my site, even though my config file clearly shows v11:

The site will crash saying v12 couldn't be found:
Could not load file or assembly 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Note: I currently have Office 2003 & 2007 installed on my dev machine, also, when looking @ references I am given the option of selecting v11 or v12 (so v11 is def. there).

Within a page on the site the page does an import statement for Microsoft.Office.Interop.Word. Is it possible to specify the version at this point, or any way to force it to use v11 without me uninstalling my v12?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

莳間冲淡了誓言ζ 2024-09-24 18:55:54

问题已经解决了。

详细信息如下:

最初在仅包含 v12 的系统上编译。安装了 v11 并将参考替换为 v11。

事实证明,GAC 仍在考虑 v12。我通过删除引用然后尝试编译(当然会崩溃),然后添加引用来刷新它。到 v11。

所以最终,问题只是与旧裁判有关。仍然存在(尽管 VS 看起来好像 v12 已被删除并添加了 v11)。

The problem has been solved.

Here are the details:

Originally compiled on a system w/ only v12. Installed v11 and replaced the reference with v11.

Turns out the GAC was still thinking v12. I flushed it out by deleting the references and then attempting to compile (which of course crashes), then adding the ref. to v11.

So in the end, the issue was just related to the old ref. still existing (even though VS made it seem as though v12 had been removed and v11 had been added).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文