我遇到了一个奇怪的问题。我正在开发使用Visual Studio 2010和VSTO 3.0的Outlook 2007插件,并使用ClickOnce进行部署。关于DependentPlatformMissingException的任何想法Microsoft.Vbe.Interop.Forms版本11.0.0.0
我想检查是否有更新,如果是的话提示用户重新启动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 { 公共部分类的ThisAddIn { 私人无效ThisAddIn_Startup(对象发件人,发送System.EventArgs) { 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
}
}
我相信这是VSTO 3,因为这是Outlook 2007中的.NET 3.5解决方案。如何进行双重检查? – mat3 2010-06-30 08:45:00
如果您使用Visual Studio 2010进行开发,除非您专门将VSTO 3 Runtime从VS2008移到VS2010,否则它是VSTO 4 Runtime。对于.NET 3.5 VS2007插件, (我应该知道,我写了一个) 为了确定,点击发布面板中的先决条件按钮,看看选择了什么,你应该选择VSTO 4 Runtime,以及2007 PIA。 – RobinDotNet 2010-07-02 02:18:46
Hi Robin, 我选择了VSTO 4 Runtime和2007 PIA,但仍然存在相同的问题。在绝望中,我选择了所有的先决条件,但没有运气,仍然得到相同的错误。 你可以尝试这个示例项目,为我解决这个问题,看看你是否得到相同的错误?我在这个评论中已经用完了字符,所以我会把链接放在下一个评论 – mat3 2010-07-02 05:50:30