Outlook 2003 加载项无法加载,但可以正常工作

发布于 2024-10-26 10:57:04 字数 2161 浏览 6 评论 0原文

我已经为 2003 年、2007 年和 2007 年创建了 Outlook 加载项。 2010 年。该加载项在 2007 年和 2010 年工作正常,但在 2003 年在除我自己的开发机器之外的任何机器上都无法正确加载。不存在代码问题,因为加载行为中没有显示错误,并且它不是禁用的项目。该加载项也不会显示在 COM 加载项列表中。该插件之前曾在 2003 下运行。

这是奇怪的部分。我有一个较早时间点的加载项副本,因此不包含完整版本的某些功能。该加载项在 2003 年正确加载。因此,作为测试的一部分,我在虚拟机上安装了早期版本(我将其称为测试)和无法运行的当前版本(我将其称为完整)。在HKCU下的注册表中>软件>班级> CLSID> [[指导]]> InprocServer32,对于测试版本,我将“清单位置”和“清单名称”键更改为完整版本的值。然后我运行 Outlook,完整版运行完美。

我不明白为什么完整加载项在其自己的注册表设置下不起作用,但在测试下运行良好,并且仅在 Outlook 2003 上运行。

这是基本信息:

我的开发设置是:

  • 安装了Windows 7 64 位
  • Outlook 2003,
  • 为外接程序项目运行 VS2008,但也使用 VS2010 进行附属程序集。
  • 包含并修改了 Set Security 项目,以允许多个程序集设置 CASPol。

安装项目中包含以下先决条件:

  • .Net 2.0
  • .Net 3.5SP1
  • Office 2003 PIA(还有分别用于 2007 和 2010 的 2007 和 2010 PIA)
  • VSTOSE 运行时
  • Windows Installer 3.1

任何提示将不胜感激,因为我这个问题花了近4天的时间!

TIA。


更新1:

根据@JoaoAngelo评论,我检查了注册表设置,它们如下:

HKCU >软件>班级> CLSID> {插件CLSID}> InprocServer32

 - (default) - '%CommonProgramFiles%\Microsoft Shared\VSTO\8.0\AddinLoader.dll'
 - ManifestLocation - path to the containing folder
 - ManifestName - the .dll.manifest file name
 - ThreadingModel - 'Both'

HKCU >软件>微软>办公室>展望>插件> MyAddin

 - (default) - not set
 - CommandLineSafe - '1'
 - Description - a string
 - FriendlyName - add-in ID
 - LoadBehavior - '3' (this never gets set to 2, which would indicate an issue)
 - Manifest - path to the .dll.manifest of the add-in assembly
 - Path - path to the containing folder

我还在后者下添加了以下内容,根据部署页面,但无济于事:

 - ManifestLocation 
 - ManifestName

更新2:

根据0xA3评论;根据HKCR> MyAddin 我有一个带有单个字符串值的 CLSID 键:

(default) - {add-in CLSID}

CLSID 与 HKCU > 中看到的相同。软件>班级> CLSID 和整个注册表。

I have created an Outlook add-in for 2003, 2007 & 2010. The add-in works fine in 2007 and 2010, but is not loading correctly in 2003 on any machines, other than my own dev machine. There are no code issues, as there are no errors shown in the load behaviour, and it is not a disabled item. The add-in is also not shown in the list of COM Add-Ins. This add-in has worked under 2003 previously.

Here's the strange part. I have a copy of the add-in from an earlier point in time, so does not contain some of the features of the full version. This add-in loads correctly in 2003. So as part of my testing, on a VM, I installed the earlier version (I'll call it test) and the current version which doesn't work (I'll call it full). In the registry under HKCU > Software > Classes > CLSID > [[guid]] > InprocServer32, for the test version I changed the 'Manifest Location' and 'Manifest Name' keys to be the values of the full version. I then ran Outlook, and the full version ran perfectly.

I can't see how the full add-in does not work under it's own registry settings, but works fine under test's, and only on Outlook 2003.

Here's the basic info:

My dev setup is:

  • Windows 7 64-bit
  • Outlook 2003 installed
  • Running VS2008 for the Add-in project, but also use VS2010 for a satellite assembly.
  • Set Security project is included and amended to allow multiple assemblies to have CASPol set.

The following pre-reqs are included in the setup project:

  • .Net 2.0
  • .Net 3.5SP1
  • Office 2003 PIA (also 2007 & 2010 PIAs for 2007 & 2010 respectively)
  • VSTOSE runtime
  • Windows Installer 3.1

Any hints would be greatly appreciated, as I've spend nearly 4 days on this issue!

TIA.


Update 1:

As per @JoaoAngelo comments I checked the registry settings, and they are as follows:

HKCU > Software > Classes > CLSID > {add-in CLSID} > InprocServer32

 - (default) - '%CommonProgramFiles%\Microsoft Shared\VSTO\8.0\AddinLoader.dll'
 - ManifestLocation - path to the containing folder
 - ManifestName - the .dll.manifest file name
 - ThreadingModel - 'Both'

HKCU > Software > Microsoft > Office > Outlook > Addins > MyAddin

 - (default) - not set
 - CommandLineSafe - '1'
 - Description - a string
 - FriendlyName - add-in ID
 - LoadBehavior - '3' (this never gets set to 2, which would indicate an issue)
 - Manifest - path to the .dll.manifest of the add-in assembly
 - Path - path to the containing folder

I also added the following under the latter, as per the Deployment page, but to no avail:

 - ManifestLocation 
 - ManifestName

Update 2:

As per 0xA3 comments; Under HKCR > MyAddin I have a CLSID key with a single string value:

(default) - {add-in CLSID}

The CLSID is the same as seen in HKCU > Software > Classes > CLSID and throughout the registry.

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

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

发布评论

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

评论(4

懒的傷心 2024-11-02 10:57:04

我终于找到了问题所在,它与注册表有关。

我最初计划为每个版本的 Outlook 提供单独的加载项,因此我的命名空间和命名约定等为:

  • [Company].AddIns.Outlook2003
  • [Company].AddIns.Outlook2007
  • [Company].AddIns.Outlook2010

但是,我设法创建针对所有 3 个加载项的加载项,因此我将 [Company].AddIns.Outlook2003 重命名为 [Company].AddIns.Client。

我更改了 HKCU > 的注册表设置软件>微软>办公室>展望>插件> MyAddin,参考所描述的更改,但由于某种原因我没有在 HKCU > 下更新它软件>课程。

当我在VS中更改后一个设置后,它就起作用了!

作为参考,这些更改是在 VS 中的“设置项目”下的“查看”>“设置”下进行的。登记处。

有点烦人的是这个问题在 2007/2010 下没有出现,因为它可能更容易追踪。

I finally managed to find the issue, it was registry related.

I originally planned to have separate add-ins for each version of Outlook, and as such my namespaces and naming conventions etc were:

  • [Company].AddIns.Outlook2003
  • [Company].AddIns.Outlook2007
  • [Company].AddIns.Outlook2010

However, I managed to create the add-in to target all 3, so I renamed [Company].AddIns.Outlook2003 to be [Company].AddIns.Client.

I'd changed the registry settings for HKCU > Software > Microsoft > Office > Outlook > Addins > MyAddin, to reference the change described, but for some reason I didn't update it under HKCU > Software > Classes.

As soon as I changed the latter settings in VS, it worked!

For reference the changes were made in VS under the Setup Project, under View > Registry.

A bit annoying that this issue didn't appear under 2007/2010, as it may have been easier to track down.

南渊 2024-11-02 10:57:04

如果您还没有这样做,您应该设置以下环境变量来帮助您解决加载项加载问题:

  • VSTO_LOGALERTS=1
  • VSTO_SUPPRESSDISPLAYALERTS=0

第一个将导致在包含插件程序集的目录中创建一个 *.log 文件,第二个文件将在您启动目标应用程序(在本例中为 Outlook)时显示错误弹出窗口。

您还说,在装有 Office 2003 的开发盒中,插件工作正常。由于在执行生成时 Visual Studio 会自动在开发框中注册插件,因此您应该确保在设置中创建所有必需的注册表项。您可以检查以下 MSDN 文章中的必需的注册表项部分,以验证您是否在安装程序中创建了正确的密钥:

部署应用程序级加载项

If you haven't done it already you should set the following environment variables to assist you in troubleshooting addin loading problems:

  • VSTO_LOGALERTS=1
  • VSTO_SUPPRESSDISPLAYALERTS=0

The first one will result in a *.log file being created in the directory containing the addin assemblies and the second will enable errors popups to be shown when your start the target application, in this case Outlook.

You also say, that in your dev box with Office 2003 the addin works correctly. Since Visual Studio automatically registers the addin in the dev box when you perform a build, you should make sure that you are creating all necessary registry keys in the setup. You can check the Required Registry Entries section in the following MSDN article to verify that you have the correct keys being created in setup:

Deploying Application-Level Add-ins

奶气 2024-11-02 10:57:04

我建议按照此处描述的故障排除步骤进行操作:

Hamed Ahmadi:我的 Office 插件无法加载!

I'd recommend to follow the troubleshooting steps described here:

Hamed Ahmadi: My Office Addin Does Not Load!

失去的东西太少 2024-11-02 10:57:04

您确定该插件没有因某种原因被 Outlook 禁用吗?如果您已在计算机级别(而不是用户级别)安装它,则无论如何它都不会显示在 Com 加载项列表中。也许尝试将其安装为每个用户添加(因此它确实显示在列表中)并从那里开始?

Are you sure the addin hasn't been disabled by outlook for some reason? If you've installed it machine level (as opposed to user level) it won't show up in the Com add in's list in any event. Maybe try installing it as a per user add in (so it does show up in the list) and go from there?

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