无法调试或运行 Word 插件,因为未安装所需的 Microsoft Office 版本 [英] Cannot debug or run Word AddIn because the required version of Microsoft Office is not installed

查看:118
本文介绍了无法调试或运行 Word 插件,因为未安装所需的 Microsoft Office 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要处理现有的 Word 2007 插件项目,该项目是 MSVS 2008 解决方案的一部分.但是,当我尝试调试插件时,收到以下错误消息:您无法调试或运行此项目,因为未安装所需版本的 Microsoft Office 应用程序".我安装了 Office 2007.

I need to work on an existing Word 2007 addIn project that's a part of a MSVS 2008 solution. However, when I try to debug the addIn, I get the following error message: "You cannot debug or run this project, because the required version of the Microsoft Office application is not installed". I have Office 2007 installed.

我尝试在同一个解决方案中创建一个新的 Word 2007 插件项目,并且调试它没有问题.据我所知,这两个项目之间所有引用的 Office 程序集都是相同的.

I tried creating a new Word 2007 addIn project in the same solution, and I have no problem debugging it. As far as I can tell, all the referenced Office assemblies are the same between these two projects.

引用的 Office 程序集:

Referenced Office assemblies:

Microsoft.Office.Interop.Word (c:Program Files (x86)Microsoft Visual Studio 9.0Visual Studio Tools for OfficePIAOffice12Microsoft.Office.Interop.Word.dll)

Microsoft.Office.Interop.Word (c:Program Files (x86)Microsoft Visual Studio 9.0Visual Studio Tools for OfficePIAOffice12Microsoft.Office.Interop.Word.dll)

Microsoft.Office.Tools.Common.v9.0 (c:Program Files (x86)Reference AssembliesMicrosoftVSTOv9.0Microsoft.Office.Tools.Common.v9.0.dll)

Microsoft.Office.Tools.Common.v9.0 (c:Program Files (x86)Reference AssembliesMicrosoftVSTOv9.0Microsoft.Office.Tools.Common.v9.0.dll)

Microsoft.Office.Tools.v9.0 (c:Program Files (x86)Reference AssembliesMicrosoftVSTOv9.0Microsoft.Office.Tools.v9.0.dll)

Microsoft.Office.Tools.v9.0 (c:Program Files (x86)Reference AssembliesMicrosoftVSTOv9.0Microsoft.Office.Tools.v9.0.dll)

Microsoft.Office.Tools.Word.v9.0 (c:Program Files (x86)Reference AssembliesMicrosoftVSTOv9.0Microsoft.Office.Tools.Word.v9.0.dll)

Microsoft.Office.Tools.Word.v9.0 (c:Program Files (x86)Reference AssembliesMicrosoftVSTOv9.0Microsoft.Office.Tools.Word.v9.0.dll)

Office (c:Program Files (x86)Microsoft Visual Studio 9.0Visual Studio Tools for OfficePIAOffice12Office.dll)

Office (c:Program Files (x86)Microsoft Visual Studio 9.0Visual Studio Tools for OfficePIAOffice12Office.dll)

stdole c:Program Files (x86)Microsoft Visual Studio 9.0Visual Studio Tools for OfficePIAOffice11stdole.dll

stdole c:Program Files (x86)Microsoft Visual Studio 9.0Visual Studio Tools for OfficePIAOffice11stdole.dll

我尝试重建,在 Debug 和 Release 配置下开始调试.没有任何帮助.我还缺少什么可能导致调试旧项目出现问题的问题?

I tried rebuilding, starting debug under both Debug and Release configurations. Nothing helps. What else am I missing that could cause a problem with debugging the old project?

推荐答案

显然,在创建 addin 项目时,会保存 MS Office 版本和用于调试的可执行路径等调试信息在 .CSPROJ 文件中.

Apparently, when the addin project is created, debug information such as the MS Office version and the executable path used for debugging is saved in the .CSPROJ file.

所以不能保证调试在另一台机器上工作.

So debug is not guaranteed to work on another machine.

此信息保存在项目文件的以下 XML 节点中:

This information is saved in following XML node of the project file:

ProjectExtensions VisualStudio FlavorProperties ProjectProperties

ProjectExtensions VisualStudio FlavorProperties ProjectProperties

就我而言,问题出在属性上

In my case, the problem was in the attributes

  • OfficeVersion="14.0"
  • DebugInfoExeName="#SoftwareMicrosoftOffice14.0WordInstallRootPath#WINWORD.EXE"

将 14.0 的值更改为 12.0(2010 年至 2007 年)解决了我的问题.

Changing 14.0 to 12.0 (2010 to 2007) in their values solved my problem.

查看这些问题以供参考:

Check out these questions for reference:

这篇关于无法调试或运行 Word 插件,因为未安装所需的 Microsoft Office 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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