简体   繁体   English

已安装Outlook COM加载项,但未在Outlook中加载

[英]Outlook COM addin installed but not loading in Outlook

I have created an Outlook addin using Visual Studio 2010 that installs fine and creates the appropriate registry keys and folders in Program Files (x86) as I have specified and it shows in Add and Remove programs. 我已经使用Visual Studio 2010创建了一个Outlook插件,该插件可以很好地安装并按照我的指定在程序文件(x86)中创建适当的注册表项和文件夹,并显示在添加和删除程序中。

However, when I launch Outlook 2010 - it doesn't show up and when I check the COM Addins, it is not available in the list. 但是,当我启动Outlook 2010时-它不会出现,并且当我检查COM加载项时,它在列表中不可用。 I created the Setup in VS and added the Output of the main project in the file system as usual and also included the .vsto file. 我在VS中创建了安装程序,并像往常一样在文件系统中添加了主项目的输出,还包括了.vsto文件。

Any pointers anyone please? 任何指针有人吗?

Since you are running x64 OS and x64 Office , you don't use Wow6432Node - it's only there for Registry Reflection for 32-bit apps on x64 OS . 由于您正在运行x64 OSx64 Office ,因此无需使用Wow6432Node仅用于x64 OS上的32位应用程序的注册表反射 The proper registry hive for you to use is below.... 下面是供您使用的正确注册表配置单元。...

All User Hive (x64 Office on x64 OS) 所有用户配置单元(x64 OS上的x64 Office)

HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Outlook\Addins\[add-in ID]

See related SO post regarding proper VSTO registry paths . 有关正确的VSTO注册表路径,请参阅相关的SO帖子

You can run your add-in via HKLM for all users WITHOUT ClickOnce with this hard-to-find trick: 您可以通过HKLM为所有用户运行外接程序,而无需ClickOnce即可使用此难找的技巧:

Put a pipe and a "vstolocal" flag after your VSTO manifest path value thus: 在您的VSTO清单路径值之后放置一个管道和一个“ vstolocal”标志,因此:

at HKLM\\Software\\Microsoft\\Office\\Outlook\\Addins\\MyVSTOAddIn HKLM \\ Software \\ Microsoft \\ Office \\ Outlook \\ Addins \\ MyVSTOAddIn
manifest="C:\\Program Files\\Publisher\\MyVSTOAddIn\\MyVSTOAddIn.vsto|vstolocal" manifest =“ C:\\ Program Files \\ Publisher \\ MyVSTOAddIn \\ MyVSTOAddIn.vsto | vstolocal”

(See: http://blogs.msdn.com/b/vsto/archive/2010/03/08/deploying-your-vsto-add-ins-to-all-users-saurabh-bhatia.aspx ) (请参阅: http : //blogs.msdn.com/b/vsto/archive/2010/03/08/deploying-your-vsto-add-ins-to-all-users-saurabh-bhatia.aspx

and set the EnableLocalMachineVSTO flag like so: 并按如下所示设置EnableLocalMachineVSTO标志:

at HKLM\\Software\\Microsoft\\Office\\14.0\\Common\\General HKLM \\ Software \\ Microsoft \\ Office \\ 14.0 \\ Common \\ General
(DWORD) EnableLocalMachineVSTO=1 (DWORD)EnableLocalMachineVSTO = 1

(See: http://social.msdn.microsoft.com/Forums/vstudio/en-US/e724cdcb-ccad-4d9f-826a-65a6816409f9/vsto-alluser-addin-fails-to-load-on-several-clients ) (请参阅: http//social.msdn.microsoft.com/Forums/vstudio/en-US/e724cdcb-ccad-4d9f-826a-65a6816409f9/vsto-alluser-addin-fails-to-load-on-several-clients

Also, if you are installing to a 64-bit version of Windows, you will have to enable local machine installation with two values in another location: 另外,如果要安装到64位版本的Windows,则必须在其他位置启用具有两个值的本地计算机安装:

at HKLM64\\SOFTWARE\\Microsoft\\VSTO Runtime Setup\\v4 HKLM64 \\ SOFTWARE \\ Microsoft \\ VSTO Runtime Setup \\ v4中
(DWORD) EnableVSTOLocalUNC=1 (DWORD)EnableVSTOLocalUNC = 1
(DWORD) EnableLocalMachineVSTO=1 (DWORD)EnableLocalMachineVSTO = 1

(See: http://support.microsoft.com/kb/2022442 ) (请参阅: http : //support.microsoft.com/kb/2022442

No SideBySide, no PromptingLevel, no VSTO\\Security\\Inclusion, and no Active Setup\\Installed Components "StubPath" necessary! 不需要SideBySide,PromptingLevel,VSTO \\ Security \\ Inclusion和Active Setup \\ Installed组件“ StubPath”! Just install and run. 只需安装并运行。

Added 10/03/2013... 添加10/03/2013 ...

It also turns out that Outlook 2010 in Win64 has further difficulty trusting VSTO add-ins unless you sign them with a real Code Signing PFX and put the certificate in the Trusted Publishers store of the user's machine. 事实证明,除非您使用真正的代码签名PFX对VSTO加载项进行签名并将证书放入用户计算机的“ 受信任的发布者”存储库中,否则Win64中的Outlook 2010很难信任VSTO加载项。 I wrote this command line utility with the PFX embedded in the executable to make the certificate part of the installation process. 我编写了此命令行实用程序,并在可执行文件中嵌入了PFX,以使证书成为安装过程的一部分。 To gain access to the local machine Trusted Publishers store, this must be run as administrator: 要访问本地计算机的Trusted Publishers存储,必须以管理员身份运行:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.IO;

namespace TrustCert
{
    class Program
    {
        static void Main(string[] args)
        {
            string msg = "";
            try
            {
                byte[] pfx;
                var assembly = typeof(Program).Assembly;
                string pfxName = "";
                foreach (string mr in assembly.GetManifestResourceNames())
                {
                    if (mr.Contains("MyPfxName"))
                    {
                        pfxName = mr;
                        break;
                    }
                }
                using (var stream = assembly.GetManifestResourceStream(pfxName))
                {
                    pfx = new byte[stream.Length];
                    stream.Read(pfx, 0, pfx.Length);
                }
                X509Certificate2 cert = new X509Certificate2(pfx, "pfxPassword");
                X509Store store = new X509Store(StoreName.TrustedPublisher
                    , StoreLocation.LocalMachine);
                store.Open(OpenFlags.ReadWrite);
                store.Add(cert);
                store.Close();
                msg = "Certificate installed";
            }
            catch (Exception e)
            {
                msg = e.ToString();
            }
            Console.WriteLine(msg);
        }
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM