Commands will be deleted from a custom toolbar, too!


Aaaarg - I created a "custom" toolbar with VsTortoise commands on and now closing Visual Studio causes VsTortoise to delete even these commands from my Toolbar, instead of only deleting from menus.
Is this intended and so on no toolbar with VsTortoise commands possible anymore?
Closed Feb 7, 2014 at 5:57 AM by pschraut
Fixed in beta 33, revision 74492.


pschraut wrote Feb 18, 2011 at 10:34 AM

Ouch! This is my fix to remove duplicated buttons, I didn't think about custom toolbars. I have to further investigate how to solve the problem otherwise. BTW, the buttons also get deleted every time you close Visual Studio. So there is no chance to get custom toolbars working with build 29, I guess.

MartinLemburg wrote Feb 22, 2011 at 11:07 AM

It shouldn't be the problem to test the CommandBar for being the type vsCommandBarType.vsCommandBarTypeToolbar or MsoBarType.msoBarTypeNormal to prevent the deletion of Command objects, right?

MartinLemburg wrote Feb 22, 2011 at 11:18 AM

Not to prevent the deletion of Command objects, but of CommandBarControl's.

What's with something like:
For Each cmdBar As Microsoft.VisualStudio.CommandBars.CommandBar In m_applicationObject.CommandBars
    If cmdBar.Type <> Microsoft.VisualStudio.CommandBars.MsoBarType.msoBarTypeNormal Then
        For Each ctrl As Microsoft.VisualStudio.CommandBars.CommandBarControl In cmdBar.Controls
            If ctrl.Tag = m_addInInstance.ProgID Then
            End If
    End If

wrote Feb 14, 2013 at 8:40 PM

pschraut wrote Oct 28, 2013 at 7:23 PM

Hi, just to let you know... Not sure if you thought it's ever going to happen and if you're still using VsTortoise, but I started working on this issue. It's changeset 73926 (https://vstortoise.codeplex.com/SourceControl/changeset/73926), located in a separate branch, in case you want to do a check-out.

It seems it's already working. Toolbars stay alive no matter how often you restart VS. I work with that version for a couple of days already, a workmate started to use it today. No issue found so far, but I better keep testing.

If you want a compiled version as setup, please let me know and I'll attach it to this ticket.

wrote Feb 7, 2014 at 5:57 AM