SOLVED

MSIX-package with using VC++ runtime redistributable (14.21.27702)

Copper Contributor

I have the following situation:

I have WinForms-application (used .NET Framework 4.7.2) which is starting Visio and loading a Visio Add-on (a VSL) which is using the VC++ runtime redistributable (14.21.27702). Visio and the VC++ runtime redistributables are installed locally on the Windows 10 system.

 

The WinForms-application is which is installed via a msix-package (made with InstallShield 2019R3; this msix is used in a sideloading scenario) is starting correctly. However when I start Visio from the WinForms-application Visio is started, but the Visio Add-on (VSL) is loading the following exception occurs:

 
System.Runtime.InteropServices.COMException (0x86DB08A9): Invalid parameter.
   at Microsoft.Office.Interop.Visio.AddonsClass.get_Item(Object NameOrIndex)

 

I have also made an AppV-package of the same WinForms-application and I start Visio from the WinForms-application and loading the Visio Add-on everything is going fine. The AppV-package is installed on the same machine as the Msix-package.

 

I have had the same issue with the AppV-package when the VC++ redistributable (14.21.27702) was not installed.

 

Does anyone have suggestions for what I could do?

 

Kind Regards,

Thierry

4 Replies

Hi @Thierry1967, how are you launching Visio and the addon? Are either Visio or the addon packaged as an MSIX? 

Hi @Dian Hartono,

 

Thank you for your response.

Visio is launched via the Microsoft Office Visio Interop. Example code (C#):

         VisioInterop.Application application = new VisioInterop.Application();

The Visio addon is loaded also via the Microsoft Office Visio Interop. Example code (C#):

        protected override VisioInterop.Addon LoadMavimVslAddon()
        {
            Microsoft.Office.Interop.Visio.Addon vslAddon = null;
            try
            {
                // Return
                short eventsEnabled = this._application.EventsEnabled;
                bool showFileOpenWarnings = this._application.Settings.ShowFileOpenWarnings;
                bool showFileSaveWarnings = this._application.Settings.ShowFileSaveWarnings;
                this._application.EventsEnabled = (short)0;
                this._application.Settings.ShowFileOpenWarnings = false;
                this._application.Settings.ShowFileSaveWarnings = false;
                vslAddon = this._application.LoadAddon(VslFilePath, "MavimVsl");
                this._application.Settings.ShowFileOpenWarnings = showFileOpenWarnings;
                this._application.Settings.ShowFileSaveWarnings = showFileSaveWarnings;
                this._application.EventsEnabled = eventsEnabled;
            }
            catch
            {
                throw;
            }
            return vslAddon;
        }

 

internal static class VisioExtensions
    {
        internal static Microsoft.Office.Interop.Visio.Addon LoadAddon(this Microsoft.Office.Interop.Visio.Application application, string addonFileName, string addonName)
        {
            if (!System.IO.File.Exists(addonFileName))
            {
                throw new System.IO.FileNotFoundException();
            }
            application.Addons.Add(addonFileName);
            Microsoft.Office.Interop.Visio.Addon addon = application.Addons[addonName];
            return addon;
        }
    }

 

LoadAddon is an extension method on the Visio application.

The VslFilePath refers to the path where the addon is located and the addon is part of the msix-package. So the WinForms-application including the addon are packaged as a msix-package.

 

Visio is installed locally on the machine (and is not packaged). I noticed that Visio is started from the WinForms application. However, when loading the Visio addon an exception occurs.

 

I hope you have an idea what is happening.

 

Kind regards,

Thierry

 

Hi @Dian Hartono :

 

Any news on this issue or is this architecture too complex for the MSIX-technology ?

 

A .NET Framework Winforms Application which is launching Visio and subsequently loading a Visio Addon (VSL) which uses the VC++ runtime redistrutable. Furthermore are the .NET Framework Winforms Application and Visio Addon (VSL) communicating with each other via the WCF technology. 

 

Do I have to include Visio as wel in the MSIX-package in some way?

 

As earlier mentioned with an AppV-package this is all working...

 

Kind regards,

 

Thierry 

best response confirmed by Sharla_Akers (Microsoft)
Solution

@Thierry1967:

 

It look's that there has been reported related issue with the same exception:

 

https://techcommunity.microsoft.com/t5/msix-deployment/msix-packaging-of-office-applications-visio-p...

 

Office is working with Windows to integrate MSIX In a future release, according 

1 best response

Accepted Solutions
best response confirmed by Sharla_Akers (Microsoft)
Solution

@Thierry1967:

 

It look's that there has been reported related issue with the same exception:

 

https://techcommunity.microsoft.com/t5/msix-deployment/msix-packaging-of-office-applications-visio-p...

 

Office is working with Windows to integrate MSIX In a future release, according 

View solution in original post