簡體   English   中英

已安裝Outlook COM加載項,但未在Outlook中加載

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

我已經使用Visual Studio 2010創建了一個Outlook插件,該插件可以很好地安裝並按照我的指定在程序文件(x86)中創建適當的注冊表項和文件夾,並顯示在添加和刪除程序中。

但是,當我啟動Outlook 2010時-它不會出現,並且當我檢查COM加載項時,它在列表中不可用。 我在VS中創建了安裝程序,並像往常一樣在文件系統中添加了主項目的輸出,還包括了.vsto文件。

任何指針有人嗎?

由於您正在運行x64 OSx64 Office ,因此無需使用Wow6432Node僅用於x64 OS上的32位應用程序的注冊表反射 下面是供您使用的正確注冊表配置單元。...

所有用戶配置單元(x64 OS上的x64 Office)

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

有關正確的VSTO注冊表路徑,請參閱相關的SO帖子

您可以通過HKLM為所有用戶運行外接程序,而無需ClickOnce即可使用此難找的技巧:

在您的VSTO清單路徑值之后放置一個管道和一個“ vstolocal”標志,因此:

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

(請參閱: http : //blogs.msdn.com/b/vsto/archive/2010/03/08/deploying-your-vsto-add-ins-to-all-users-saurabh-bhatia.aspx

並按如下所示設置EnableLocalMachineVSTO標志:

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

(請參閱: http//social.msdn.microsoft.com/Forums/vstudio/en-US/e724cdcb-ccad-4d9f-826a-65a6816409f9/vsto-alluser-addin-fails-to-load-on-several-clients

另外,如果要安裝到64位版本的Windows,則必須在其他位置啟用具有兩個值的本地計算機安裝:

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

(請參閱: http : //support.microsoft.com/kb/2022442

不需要SideBySide,PromptingLevel,VSTO \\ Security \\ Inclusion和Active Setup \\ Installed組件“ StubPath”! 只需安裝並運行。

添加10/03/2013 ...

事實證明,除非您使用真正的代碼簽名PFX對VSTO加載項進行簽名並將證書放入用戶計算機的“ 受信任的發布者”存儲庫中,否則Win64中的Outlook 2010很難信任VSTO加載項。 我編寫了此命令行實用程序,並在可執行文件中嵌入了PFX,以使證書成為安裝過程的一部分。 要訪問本地計算機的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