Vsto PPT plug-in development, add a custom button to the right-click menu, there is a compatibility problem, I developed on my own computer, there is no error exception, this error occurs on the client computer

I used vsto technology to develop a com add-in for PPT.
one of the requirements is to add a custom menu button to the right-click menu.
I finished writing on my computer, and there was no problem.
but this error occurred when running on the customer"s computer

.
Jul.08,2022

Hello, has this problem been solved? how do you get the ppt custom add right-click menu? I also encountered the same problem, which has been bothering me for a long time.


has been solved and has not been sorted out. Paste the code of the implementation directly:

using Application.BaseData;
using Application.Config;

using Common.Logging;

using Infrastructure;

using Microsoft.Office.Core;

using stdole;

using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

using Util.Controls.WinForm;

using Utilities.Converter;

using VarEnum;

using WpfUi.View.MaterialSet;
using WpfUi.ViewModel.MaterialSet;
using WpfUi.ViewModel.MaterialSet.Model;

namespace PowerPointAddIn.Vstor
{
    /// <summary>
    /// 
    /// </summary>
    public class ContextMenuEx
    {
        private static readonly ILog _log = LogManager.GetLogger("ContextMenuEx");

        readonly CommandBars cmdBars;
        readonly CommandBar cmdThumbnailsBar;

        CommandBarButton insertResourceBtn = null;

        public ContextMenuEx()
        {
            try
            {
                cmdBars = ThisAddIn.application.CommandBars;
                cmdThumbnailsBar = cmdBars[ThisAddIn.officeType == OfficeType.Office ? "Thumbnails" : "Slide Miniature Popup Menu"];
                cmdThumbnailsBar.Reset();

                SetInsertResource();
            }
            catch (Exception err)
            {
                _log.Error(err);
            }
        }
        /// <summary>
        ///  
        /// </summary>
        public void SetInsertResource()
        {
            CommandBarControls commandBarControls = cmdThumbnailsBar.Controls;

            foreach (CommandBarControl cmdBarCtrl in commandBarControls)
                if (cmdBarCtrl.Tag == "InsertResource")
                    cmdBarCtrl?.Delete();

            string icon_stem = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, @"Resources\icon-sucai32.png");
            IPictureDisp pictureInsertResource = AxHostConverter.GetIPictureDisp(icon_stem);

            Globals.ThisAddIn.Dispatcher.Invoke(() =>
            {
                insertResourceBtn = (CommandBarButton)commandBarControls.Add(MsoControlType.msoControlButton);
                insertResourceBtn.BeginGroup = true;
                insertResourceBtn.Tag = "InsertResource";
                insertResourceBtn.Caption = "";
                insertResourceBtn.Picture = pictureInsertResource;
                insertResourceBtn.Click += InsertResourceBtn_Click;
                insertResourceBtn.Visible = true;
            });
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="state"></param>
        public void SwitchInsertResource(bool state)
        {
            if (insertResourceBtn == null) return;
            try
            {
                insertResourceBtn.Visible = state;
            }
            catch (Exception err)
            {
                _log.Error(err);
            }
        }

        private void InsertResourceBtn_Click(CommandBarButton Ctrl, ref bool CancelDefault)
        {
            try
            {
                if (string.IsNullOrEmpty(Config.UserInfo?.UserId))
                    throw new Exception("")
                    {
                        Source = Envirment.ErrUiSource
                    };

                var viewMode = new MaterialSetViewModel(new BaseDataApplication(), Config.UserInfo.UserId, Config.SchoolCode);
                viewMode.InsertElement2Slide += InsertElement2Slide;
                viewMode.SetWindow(new MaterialSetView());
                ThisAddIn.Show(viewMode.Window);
            }
            catch (Exception err)
            {
                Ex.GlobalUnCatchError(err);
            }
        }


        void InsertElement2Slide(List<Material> ChooseMaterials)
        {
            if (ChooseMaterials?.Count < 1)
                return;

            PptHelp pptHelp = new PptHelp();
            try
            {
                ChooseMaterials.ForEach(p =>
                {
                    if (!InternetHelp.IsFileOrExt(p.MaterialUrl, out string ext))
                    {
                        ThisAddIn.ShowDialog(new Resource.Control.AlertWin.alertWindow(new
                        {
                            message = "[" + p.Name + "]",
                        }));
                        return;
                    }

                    if (p.MaterialType == MaterialType.)
                    {
                        pptHelp.AddImg(p.MaterialUrl);
                    }
                    else if (p.MaterialType == MaterialType. || p.MaterialType == MaterialType.)
                    {
                        if (string.IsNullOrEmpty(ext))
                        {
                            ThisAddIn.ShowDialog(new Resource.Control.AlertWin.alertWindow(new
                            {
                                message = "[" + p.Name + "]",
                            }));
                            return;
                        }

                        string fileName = Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Path.GetRandomFileName(), ext));

                        FormDownload formDownload = new FormDownload(new Uri(p.MaterialUrl), fileName);
                        formDownload.ShowDialog();

                        pptHelp.AddMedia(fileName);

                        Task.Run(() =>
                        {
                            try
                            {
                                if (File.Exists(fileName))
                                {
                                    File.Delete(fileName);
                                }
                            }
                            catch { }
                        });

                    }
                });
            }
            catch (Exception ex)
            {
                ThisAddIn.ShowDialog(new Resource.Control.AlertWin.alertWindow(new
                {
                    message = ex.Message,
                }));
            }
        }
    }
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e3ae3f-42b9f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e3ae3f-42b9f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?