ToolPanelWindow in VSIX extension doesn't load

Viewed 29

Currently, I am trying to migrate a Visual Studio 2019 extension to Visual Studio 2022, I am able to build the project and install it however, one of the main windows of the extension doesn't load. During debugging it does load right

enter image description here

This is the code that is behind the window

   public class HGPendingChangesToolWindow : ToolWindowPane
   {
            private HGPendingChangesToolWindowControl control;

            public HGPendingChangesToolWindow() :base(null)
            {
                // set the window title
                this.Caption = Resources.ResourceManager.GetString("HGPendingChangesToolWindowCaption");

                // set the CommandID for the window ToolBar
                //this.ToolBar = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.imnuToolWindowToolbarMenu);

                // set the icon for the frame
                this.BitmapResourceID = CommandId.ibmpToolWindowsImages;  // bitmap strip resource ID
                this.BitmapIndex = CommandId.iconSccProviderToolWindow;   // index in the bitmap strip

                control = new HGPendingChangesToolWindowControl();

                // update pending list
                SccProviderService service = (SccProviderService)SccProvider.GetServiceEx(typeof(SccProviderService));

                if (service != null)
                {
                    UpdatePendingList(service.StatusTracker);
                }
            }

            // route update pending changes call
            public void UpdatePendingList(HGStatusTracker tracker)
            {
                control.UpdatePendingList(tracker);
            }

            // ------------------------------------------
            // returns the window handle
            // ------------------------------------------
            override public IWin32Window Window
            {
                get
                {
                    return (IWin32Window)control;
                }
            }

            /// <include file='doc\WindowPane.uex' path='docs/doc[@for="WindowPane.Dispose1"]' />
            /// <devdoc>
            ///     Called when this tool window pane is being disposed.
            /// </devdoc>
            override protected void Dispose(bool disposing)
            {
                if (disposing)
                {
                    if (control != null)
                    {
                        try
                        {
                            if (control is IDisposable)
                                control.Dispose();
                        }
                        catch (Exception e)
                        {
                            System.Diagnostics.Debug.Fail(String.Format("Failed to dispose {0} controls.\n{1}", this.GetType().FullName, e.Message));
                        }
                        control = null;
                    } 
                    
                    IVsWindowFrame windowFrame = (IVsWindowFrame)this.Frame;

                    if (windowFrame != null)
                    {
                        // Note: don't check for the return code here.
                        windowFrame.CloseFrame((uint)__FRAMECLOSE.FRAMECLOSE_SaveIfDirty);
                    }
                }

                base.Dispose(disposing);
            }

            /// <summary>
            /// This function is only used to "do something noticeable" when the toolbar button is clicked.
            /// It is called from the package.
            /// A typical tool window may not need this function.
            /// 
            /// The current behavior change the background color of the control
            /// </summary>
            public void ToolWindowToolbarCommand()
            {
                if (this.control.BackColor == Color.Coral)
                    this.control.BackColor = Color.White;
                else
                    this.control.BackColor = Color.Coral;
            }
        }

I would like to know why the window isn't loading right, I am new to VSIX.

Thanks

0 Answers
Related