Performing an toolbox upgrade

Nov 16, 2010 at 3:33 PM

Hello

I am having an problem getting the OnToolboxUpgraded event to execute for our Package integration using MPF.

We already have the product installed at client but now we need to send an update having problems updating the toolbox to reflect the new Toolbox items.

I can open VS2010 and do an reset Toolbox and see the items but closing and opening VS2010, the new toolbox items are gone.

Do I need to set some registry entry in order to get the toolbox to execute the OnToolboxUpgraded event?

Thanks

Nov 16, 2010 at 7:33 PM
Edited Nov 16, 2010 at 7:41 PM

Also forgot to mention, I did specify the ProvideToolboxItemsAttribute as follow

[ProvideToolboxItems(4, NeedsCallBackAfterReset = true)]

 

I also implemented the events and subscribed to them

Nov 17, 2010 at 9:04 AM

Did some searching and found the follow:
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivspackage.resetdefaults.aspx

I tried implementing the following code:
        int IVsPackage.ResetDefaults(uint grfFlags)
        {
            if (Zombied)
                Marshal.ThrowExceptionForHR(NativeMethods.E_UNEXPECTED);

            if (grfFlags == (uint)__VSPKGRESETFLAGS.PKGRF_TOOLBOXITEMS)
            {
                this.OnToolboxInitialized(this, EventArgs.Empty);
            }
            else if (grfFlags == (uint)__VSPKGRESETFLAGS.PKGRF_TOOLBOXSETUP)
            {
               this.OnToolboxUpgraded(this, EventArgs.Empty);
            }

            return NativeMethods.S_OK;

        }

Doing an reset on the toolbox, this code gets executed, but changing the registry value and then devenv.exe /setup  seems to have no effect.

Any idea what I could possibly be missing?