2009-01-20 83 views
1

我已經讓別人把一堆東西交給我了。這些項目中包括一個Word 2003加載項(VSTO 2005 SE,.NET 2.0),據報道在2007年工作正常,但我們的部署環境需要2003年。它安裝顯然適用於Office 2003 - 沒有錯誤,顯示在添加/刪除 - 但工具欄在Word本身內不可用。Server 2003上的Word 2003插件安裝

據說這在某人的測試環境中工作正常,但我從來沒有見過它在我們的通用開發環境中工作。我們有一個MSI和setup.exe的安裝/部署項目。 (我試過在CAB中包裝東西,以防萬一,我試過用prereqs安裝,沒有明顯差異。)

MSI,setup.exe,右鍵單擊在Visual Studio中安裝setup/deploy項目,這些方法都不報告錯誤 - 但這些方法都無法在Server 2003上的Word 2003中顯示工具欄。但是,如果我將Visual Studio指向winword.exe進行調試並啓動項目,則會顯示插件按鈕。它繼續顯示在後來的獨立客戶初創公司。它仍然可以用作工具欄,直到我通過添加/刪除或通過右鍵單擊卸載或運行MSI並刪除來顯式刪除它。

所以現在我感到茫然了 - 在典型的安裝/部署安裝過程中,調試時不會發生什麼情況?

編輯:好的,更新。爲Word 2003創建了一個乾淨的VSTO 2005加載項,新的加載項名稱clean slate。在Server 2003和XP Pro上,裸體項目,處女註冊表都會遇到同樣的情況。我是XP上的本地管理員,我是2003年的域管理員。

+0

這個網站是唯一的編程問題。閱讀常見問題。 – 2009-01-20 19:31:39

+0

插件開發很好的編程相關。 – 2009-01-20 19:33:14

回答

1

編輯:完全信任添加 - 在組裝最終成爲修復。似乎沒有比完全信任還要低。

//

端打開了與微軟的一票,他們已經教育了我關於VSTO_SUPPRESSDISPLAYALERTS:

http://msdn.microsoft.com/en-us/library/ms269003(VS.80).aspx

其默認值爲1;將其設置爲0會提供一個彈出式對話框,除此之外的內容將被掩埋。

仍在研究細節,我會繼續更新這個帖子,不過現在我們終於有哪些基礎繼續前進:

Could not load file or assembly 'PrintTest2007, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418) 


************** Exception Text ************** 
System.IO.FileLoadException: Could not load file or assembly 'PrintTest2007, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418) 
File name: 'PrintTest2007, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.Security.Policy.PolicyException: Execution permission cannot be acquired. 
    at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) 
    at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) 
    at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.HandleOnlineOffline(Exception e, String basePath, String filePath) 
    at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadStartupAssembly(EntryPoint entryPoint, Dependency dependency, Dictionary`2 assembliesHash) 
    at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ConfigureAppDomain() 
    at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadAssembliesAndConfigureAppDomain(IHostServiceProvider serviceProvider) 
    at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadEntryPointsHelper(IHostServiceProvider serviceProvider) 
2

這裏有一些問題進行故障排除:

  • 你開發什麼樣的加載項的?共享外接程序或VSTO?如果VSTO是哪個版本?
  • 你在使用什麼操作系統? Vista可能會很棘手......
  • 在註冊表中檢查加載項的LoadBehavior。你會發現的價值無論是在

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Word\Addins\<add-in class name>\ 
    

    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Word\Addins\<add-in classname>\ 
    

如果LoadBehavior的價值是2啓動過程中您的外接已被禁用。這發生在Word無法實例化插件時,通常是因爲插件引發了未處理的異常,或者更常見,因爲插件未正確註冊。

您是否已檢查VSTO運行時是否已正確安裝在目標系統上?

但是,即使您使用VSTO,對於Word,插件仍然看起來像一個經典的COM插件,它擴展了經典的IDTExtensibility2接口。這些加載項必須註冊方式如下:

  • 其中上述兩個註冊表項來告訴Word加載項以及其他信息的類名稱,如加載行爲和描述
  • 該加載的類名稱必須在

    HKEY_CLASSES_ROOT\<add-in classname>\CSLID 
    
  • COM組件的正確版本必須在註冊登記(其中{XXXXXXXXXXXX-XXXXXXXX-XXXXXXXXXXXX}是組件的GUID如在HKEY_CLASSES_ROOT \\ CSLID下指定):

    HKEY_CLASSES_ROOT\CLSID\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} 
    

以下兩個鏈接也可以幫助您進一步縮小您的問題:

HOWTO: Troubleshooting Visual Studio and Office add-ins

Troubleshooting Outlook COM Addins – Using ProcMon

相關問題