I am running into a strange issue. I am developing a Outlook 2007 addin using Visual Studio 2010 with VSTO 3.0 and deployed using ClickOnce.
I would like to check if there are any updates and if so prompt the user to restart outlook.
However if I call ApplicationDeployment.CheckForDetailedUpdate or ApplicationDeployment.CheckForUpdate I get the following exception:
DependentPlatformMissingException:
Unable to install or run the application. The application requires that assembly Microsoft.Vbe.Interop.Forms Version 11.0.0.0 be installed in the Global Assembly Cache (GAC) first.
This happens on both my dev machine and on the remote machine.
Here's what I've tried so far with no success: - Uninstalled and reinstalled Office 2007 PIAs - Added Microsoft.Vbe.Interop.Forms v 11.0.0.0 (file version 12.*) as a reference to my project - Verified that the dll with the correct version is in my GAC
I have no idea why this exception is occurring. Hope you can help.
Update I just tried this brand new VS 2010 projects. Here is my addin file
If my framework is set to .net 4, it works fine. If my framework is set to .net 3.5, I get the same exception and error.
namespace TestOutlookAddIn2 { public partial class ThisAddIn { private void ThisAddIn_Startup(object sender, System.EventArgs e) { MessageBox.Show("I'm in");
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
}
}