2011-03-30 83 views
2

我有我的第一個Outlook插件開發,2007外接部署爲DLL

我可以看到,調試外接自動打開的前景,這個問題我注意到,前景約需20秒打開時,我的加載項附加(作爲新菜單與一個按鈕)。
我想這可能由事實IM引起調試我的項目!
我發表我的加載到我的本地主機,然後使用點擊一次的事情安裝了它,但仍掛在負載
outlookAddIn2 .vsto文件被outlook用作我的自定義加載項,但是當我看到其他加載項時,他們全都是dll而不是vsto加上他們不會掛斷啓動前景

我應該如何部署我的項目爲DLL,但不凍結我的啓動前景?

預先感謝您。

PS:最終的加載項將在我們的內部網的員工面貌實現佔

編輯:

namespace OutlookAddIn2 
{ 
    public partial class ThisAddIn 
    { 



    private void ThisAddIn_Startup(object sender, System.EventArgs e) 
    { 
     MyToolBar(); 
    } 

    private void ThisAddIn_Shutdown(object sender, System.EventArgs e) 
    { 
    } 

    Office.CommandBar mainMenuBar; 
    Office.CommandBarPopup oldMenuBar; 
    Office.CommandBarPopup myMenuBar; 
    Office.CommandBarButton myButton; 

    private void MyToolBar() 
    { 
     try 
     { 
      mainMenuBar = this.Application.ActiveExplorer().CommandBars.ActiveMenuBar; 

      oldMenuBar = (Office.CommandBarPopup)this.Application.ActiveExplorer().CommandBars.ActiveMenuBar.FindControl 
       (
       Office.MsoControlType.msoControlPopup, missing, "Katakit", true,true 
       ); 
      if (oldMenuBar != null) 
       oldMenuBar.Delete(true); 
      myMenuBar = (Office.CommandBarPopup)mainMenuBar.Controls.Add(
       Office.MsoControlType.msoControlPopup, 
       missing, missing, missing, false); 


      if (myMenuBar != null) 
      { 
       // Add a button to the new toolbar. 
       myMenuBar.Caption = "Katakit"; 
       myMenuBar.Visible = true; 
       myMenuBar.Tag = "Katakit"; 
       myButton = (Office.CommandBarButton)myMenuBar.Controls.Add 
        (Office.MsoControlType.msoControlButton, missing, missing, missing, true); 
       myButton.Caption = "Pending Summary 2"; 
       myButton.FaceId = 500; 
       myButton.Tag = "btnPendingSummary"; 
       myButton.Visible = true; 


      } 
     } 
     catch (System.Exception ex) 
     { 
      System.Windows.Forms.MessageBox.Show("Error: " + ex.Message.ToString() 
               , "Error Message"); 
     } 
    } 

    #region VSTO generated code 

    /// <summary> 
    /// Required method for Designer support - do not modify 
    /// the contents of this method with the code editor. 
    /// </summary> 
    private void InternalStartup() 
    { 
     this.Startup += new System.EventHandler(ThisAddIn_Startup); 
     this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown); 
    } 

    #endregion 
} 

}

+0

你的插件是否在啓動時執行一些重負載? – HABJAN 2011-03-30 13:20:49

+0

沒有,只是新的菜單和一個按鈕 – 2011-03-30 13:22:39

+0

20秒加載只發生在第一次或每次? – HABJAN 2011-03-30 13:25:24

回答

1

也許你碰上了「檢查發行商的證書吊銷」瓶頸。它與Outlook無關,但與.net程序集運行在沒有適當的互聯網訪問的環境中。在Add-in Express論壇中參見this entry,參考this discussion。您可以禁用IE設置,也可以嘗試驗證Internet訪問。

當我的VMWare開發機器認爲它具有網絡訪問權限但主機的網絡已關閉時,我總是將自己陷入這個問題。虛擬機橋接到主機,但主機的網絡電纜未插入,或者如果VMWare guest虛擬機是運行域控制器(=>網絡可用)的域的一部分,但該網絡沒有Internet訪問權,並且沒有適當的認證機構。在這種情況下,啓動時間很慢。如果主機可以訪問Internet,則無需啓動延遲。

+0

提到的步驟沒有做到這一招!無論如何,我拔掉網線測試這個,它工作正常,我猜如果目標機器**互聯網接入**那麼這將解決我的問題,對吧? – 2011-04-03 06:10:40

+0

是的,如果目標機器上網,我從來沒有遇到過這個問題。 AFAK,也可以將用於簽署DLL的證書添加到域的CA權限 - 但我在這些管理任務中的知識非常有限,因此您可以向其他人詢問此解決方案。 – 2011-04-04 12:31:13