1
votes

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
}

}

2

2 Answers

0
votes

If you target .NET 4, it doesn't require the PIAs, it embeds just the bits it needs.

Are you really deploying the VSTO 3 runtime from VS2010? Or are you deploying VSTO 4 (it came with VS2010)?

0
votes

It seems that you need to target the .net framework 4 when you use vs2010. I had upgraded to vs2010 but left the project targetting .net3.5. Which caused the above problem. I only resolved it by reverting back to vs2008 :(

See this (duplicate question) on msdn social that has replies from the Click-once deployment MVP concerning this issue.