关于DependentPlatformMissingException的任何想法Microsoft.Vbe.Interop.Forms版本11.0.0.0

时间:2010-06-30 06:18:41

标签: clickonce vsto office-2007

我遇到了一个奇怪的问题。我正在使用带有VSTO 3.0的Visual Studio 2010开发Outlook 2007插件,并使用ClickOnce进行部署。

我想检查是否有任何更新,如果是,则提示用户重新启动outlook。

但是,如果我调用ApplicationDeployment.CheckForDetailedUpdate或ApplicationDeployment.CheckForUpdate,我会收到以下异常:

DependentPlatformMissingException:

无法安装或运行该应用程序。该应用程序要求首先在全局程序集缓存(GAC)中安装程序集Microsoft.Vbe.Interop.Forms版本11.0.0.0。

这在我的开发机器和远程机器上都会发生。

到目前为止,这是我尝试过的,没有成功: - 卸载并重新安装Office 2007 PIA - 添加了Microsoft.Vbe.Interop.Forms v 11.0.0.0(文件版本12. *)作为我项目的参考 - 已验证具有正确版本的dll在我的GAC中

我不知道为什么会发生这种异常。希望你能帮忙。

更新我刚尝试了这个全新的VS 2010项目。这是我的插件文件

如果我的框架设置为.net 4,它可以正常工作。如果我的框架设置为.net 3.5,我会得到相同的异常和错误。

命名空间TestOutlookAddIn2 {     public partial class ThisAddIn     {         private void ThisAddIn_Startup(object sender,System.EventArgs e)         {             MessageBox.Show(“我在”);

        if (ApplicationDeployment.IsNetworkDeployed)
        {
            var info = ApplicationDeployment.CurrentDeployment.CheckForDetailedUpdate();
        }
    }

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

    #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
}

}

2 个答案:

答案 0 :(得分:0)

如果您的目标是.NET 4,它不需要PIA,它只嵌入所需的位。

您是否真的从VS2010部署VSTO 3运行时?或者您正在部署VSTO 4(VS2010附带)?

答案 1 :(得分:0)

使用vs2010时,似乎需要以.net框架4为目标。我已经升级到vs2010,但离开了项目目标.net3.5。这引起了上述问题。我只是通过恢复到vs2008来解决它:(

请参阅有关此问题的Click-once部署MVP回复的this (duplicate question) on msdn social

相关问题