views:

92

answers:

1

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

}

A: 

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)?

RobinDotNet
I believe it's VSTO 3 since this is a .net 3.5 solution for Outlook 2007. How do I double check?
mat3
If you're developing with Visual Studio 2010, unless you have specifically moved the VSTO 3 Runtime from VS2008 to VS2010, it is the VSTO 4 Runtime. It works fine for a .NET 3.5 VS2007 add-in. (I should know, I wrote one.)To tell for certain, click the Prerequisites button in the publish panel and see what's selected. You should have VSTO 4 Runtime selected, and the 2007 PIAs.
RobinDotNet
Hi Robin,I have VSTO 4 Runtime selected and 2007 PIAs and still having the same issue. In a fit of desperation, I selected all the prerequisites but no luck, still getting the same error.Can you try this sample project that repros this issue for me and see if you get the same error? I've run out of chars in this comments, so I'll put the link in the next comment
mat3
Here is the link: http://dl.dropbox.com/u/4701630/TestOutlookAddIn2.zip you need Windows 7 x64, Visual Studio 2010 and Office 2007 installed with all components 1) Set breakpoint on line 19 of ThisAddIn.cs2) Build debug 3) Go to the bin\Debug folder and execute TestOutlookAddIn2.vsto4) Run Outlook and you should see a messagebox with text "I'm in"5) In Visual Studio, attach the debugger to the Outlook.exe process 6) Hit ok on the messge box and debugger should hit your break point. 7) Keep stepping and when you execute line 21, you will get DependentPlatformMissingException
mat3
wow, that screwed up the formatting. Here's a link to a SO question with the steps properly formatted: http://stackoverflow.com/questions/3160598/dependentplatformmissingexception-microsoft-vbe-interop-forms-version-11-0-0-0Thanks so much for your help.
mat3
Can you run the add-in from Visual Studio itself?
RobinDotNet
if you debug and run the sample from visual studio itself, then the ApplicationDeployment.IsNetworkDeployed returns false.So, to make it think its network deployed, need to build and run the vsto file. I've made a simpler sample that uses message boxes. Still have to run the vsto file though: http://dl.dropbox.com/u/4701630/TestOutlookAddIn3.zip It has no prerequisites because I thought that maybe screwing it up.
mat3