I create an add-in for Visual Studio 2005/2008.
My add-in follows what mz-tools decribes as
temporary UI approach . User interfaces get created each time the add-in is loaded and removed when it gets unloaded. But this has the effect, when eg Visual Studio crashes, that the add-in is
not unloaded correctly and the UI does not get removed. The next time Visual Studio is started, my add-in creates its UI again and this leads to duplicated buttons.
But even for this problem exists
this mz-tools article , that describes how to remove duplicated/dead buttons. It says the add-in should delete and re-create its commands during unload, because deleting a command removes all the associated UI.
This works well, except that is also removes all the custom user created UI. For example, one user created a custom toolbar with buttons that are binded to commands of my add-in. Everytime the add-in gets unloaded, those custom buttons get removed as well.
What is the correct procedure to prevent dead/duplicated UI, but keep user created UI intact?