Question

I developed a VSTO Excel add-in with a Ribbon containing a few buttons. When we build the add-in through our TFS build server, the ribbon isn't loaded, although the add-in itself is loaded without any errors (it's shown as active in Excel\Options\Add-Ins, I write log entries on Startup and Shutdown, which are written correctly to my log file etc.) If I use my developper machine built add-in files (.dll, .dll.manifest, .vsto) the add-in loads correctly. After long searching, we found a difference in the manifest file created by my machine and the build server. The build server manifest file seems to be missing an entry for the ribbon. Does anyone know if there's a way to influence what entries are contained in the manifest, or if there's a setting in VS, which influences the manifest creation?

The lines of the build server manifest with the ribbon look as follows:

           <vstov4:appAddIn application="Excel" loadBehavior="3" keyName="AVExport">
            <vstov4:friendlyName>AVExport</vstov4:friendlyName>
            <vstov4:description>AVExport</vstov4:description>
            <vstov4.1:ribbonTypes xmlns:vstov4.1="urn:schemas-microsoft-com:vsto.v4.1" />
          </vstov4:appAddIn>

The same lines from my developper machine manifest file look as follows:

          <vstov4:appAddIn application="Excel" loadBehavior="3" keyName="AVExport">
            <vstov4:friendlyName>AVExport</vstov4:friendlyName>
            <vstov4:description>AVExport</vstov4:description>
            <vstov4.1:ribbonTypes xmlns:vstov4.1="urn:schemas-microsoft-com:vsto.v4.1">
              <vstov4.1:ribbonType name="Publisuisse.Publiplan.Client.Offer.AddIn.AVRibbon, AVExport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
            </vstov4.1:ribbonTypes>
          </vstov4:appAddIn>

As you can see, my manifest contains an additional line which references my ribbon.

I couldn't find any information on this behaviour neither via SO search nor through google.

Any help is appreciated!

Cheers Dominik

Was it helpful?

Solution

I found the answer to my problem: Here you can find the reason the manifest didn't work anymore, and here the solution: Override the function

using Microsoft.Office.Tools.Ribbon;
protected override IRibbonExtension[] CreateRibbonObjects()
{
    return new IRibbonExtension[] { new Ribbon1(), new Ribbon2() };
}

to load the ribbons manually. Case closed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top