Hi everyone,
I've found a possible bug in VS .NET 2003:
When an add-in has created a control on a custom command bar (the command
bar was pre-created during the UISetup phase, but the control wasn't), and
the add-in attempts to remove the control upon handling the OnBeginShutdown
or OnDisconnect notifications, the add-in gets immediately reloaded.
If the command bar is made invisible prior to removing the control, the
add-in shuts down normally - UNLESS the command bar is not a menu bar which
cannot be made invisible.
The most likely reason is that when the add-in removes a control from a
command bar where other controls belonging to the add-in exist, the
QueryStatus notification is queued for the add-in and the add-in is loaded
again to respond to this notification. I believe that when an add-in is
being shutted down, no further notifications should be queued for the
add-in.
This is an extension for a community solution offered by Carlos Quintero -
Carlos, could you please post a link to your KB article here?

Signature
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx
Carlos J. Quintero [MVP] - 23 Sep 2004 15:10 GMT
Hi Dmitriy,
The article is:
Community Solutions Article - 555149
BUG: Add-in reloaded after unloaded in Visual Studio .NET.
http://support.microsoft.com/default.aspx?scid=kb;en-us;555149
I have been unable to get a status for this bug from MS (or for any of the
bugs that I have reported), despite contacting directly to Craig Skibo
(Software Development Engineer Visual Studio - Extensibility Team) and Ken
Hardy (Program Manager Visual Studio - Extensibility Team)...no
answer...bottom line: you have to live with the bugs devising your own
workarounds...

Signature
Carlos J. Quintero (Visual Developer - .NET MVP)
FAQs, Knowledge Base, Files, Docs, Articles, Utilities, etc. for .NET
addins:
http://groups.yahoo.com/group/vsnetaddin/ (free join)
> Hi everyone,
>
[quoted text clipped - 18 lines]
> This is an extension for a community solution offered by Carlos Quintero -
> Carlos, could you please post a link to your KB article here?
Dmitriy Lapshin [C# / .NET MVP] - 24 Sep 2004 13:48 GMT
Then you might be wishing to update your KB article to include additional
cases?

Signature
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx
Carlos J. Quintero [MVP] - 27 Sep 2004 12:01 GMT
Yes, send me the symptom and some source code to reproduce it and I will
include it in the article.

Signature
Carlos J. Quintero (Visual Developer - .NET MVP)
FAQs, Knowledge Base, Files, Docs, Articles, Utilities, etc. for .NET
addins:
http://groups.yahoo.com/group/vsnetaddin/ (free join)
> Then you might be wishing to update your KB article to include additional
> cases?
Dmitriy Lapshin [C# / .NET MVP] - 28 Sep 2004 15:42 GMT
I will follow up with more info later, one of the cases is when you create a
combo box (AFTER the UISetup phase) on a toolbar where other command buttons
from your add-in are present, and try to remove this combo box upon
OnDisconnect or BeginShutdown. In this case, the add-in will receive
enqueued QueryStatus notification and will be immediately loaded again to
process it.
This seems to be a kind of general rule - if something triggers QueryStatus
to be sent to the add-in upon disconnect, the add-in is immediately
reloaded.

Signature
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx
> Yes, send me the symptom and some source code to reproduce it and I will
> include it in the article.
>
>> Then you might be wishing to update your KB article to include additional
>> cases?