Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / October 2005

Tip: Looking for answers? Try searching our database.

Problem with add-in manager

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NS - 26 Oct 2005 00:31 GMT
Hi,

I have created an add-in for Visual Studio 2003. The registry value of
loadBehavior for this add-in is 1. In the OnConnection method of this add-in
I am checking

If connectMode = ext_ConnectMode.ext_cm_UISetup Or connectMode =
ext_ConnectMode.ext_cm_Startup Then
          'Add the menu items

My problem is that after installing this add-in, when I start Visual Studio
it shows me my menu items, and when I uncheck the add-in from Add-in manager,
it unloads those menu items. But somehow automatically, it checks the add-in
in the Add-in manager. I have to uncheck it again so that it doesn't reload
when I start the Visual Studio.  I can't understand what I need to do so that
once I unselected the add-in from Add-in Manager, it doesn't select it
automatically.

please tell me what is the solution for this problem.
Thanx,
NS
Carlos J. Quintero [VB MVP] - 26 Oct 2005 15:27 GMT
Hi,

Take a look at some KB articles that I wrote in a section for add-in
developers on my web site (below), specially this couple:

HOWTO: Adding buttons, commandbars and toolbars to Visual Studio .NET from
an add-in
http://support.microsoft.com/default.aspx?scid=kb;en-us;555326

and

HOWTO: Removing commands and UI elements during Visual Studio .NET add-in
uninstallation
http://support.microsoft.com/default.aspx?scid=kb;en-us;555322

because it doesn´t make sense to perform the same action for the values
ext_cm_UISetup and ext_cm_Startup as you are doing. It makes sense to create
temporary UI items in the ext_cm_Startup and ext_cm_AfterStartup (that you
are missing this latter value) and permanent UI items in the ext_cm_UISetup
phase, but not to mix them. In fact what is happening in your case is that
the add-in is actually reloaded due to a VS.NET bug but since you don´t
consider the ext_cm_AfterStartup value, you are not seeing the UI items
re-created and you think that the add-in is unloaded but checked in the
Add-in Manager. Fix this part first.

Once you see clearly that the add-in is being fully reloaded after unloading
it, see this other article that I wrote:

BUG: Add-in reloaded after unloaded in Visual Studio .NET.
http://support.microsoft.com/default.aspx?scid=kb;en-us;555149

It's fixed in VS 2005, I think.
Signature


Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

> Hi,
>
[quoted text clipped - 23 lines]
> Thanx,
> NS
NS - 27 Oct 2005 00:27 GMT
Thank you Carlos,

The posts were really helpful, so I have created temporary commandbars.
Now my problem is that I want that the commanbars should appear
automatically when I start Visual Studio after I install the add-in. In my
case I have to select the add-in from the add-in manager everytime I open
Visual studio. How can I load the commandbars automatically.

I am creating commandbars for connectMode = startup or afterstartup. I am
using VS2003.

Thanx,
Neha

> Hi,
>
[quoted text clipped - 55 lines]
> > Thanx,
> > NS
Carlos J. Quintero [VB MVP] - 27 Oct 2005 09:22 GMT
When you register your assembly as a VS.NET add-in, there is a registry
entry named LoadBehavior that sets if the add-in must be loaded
automatically when VS.NET starts. Check the docs about that setting and
ensure that you are using the proper value (3 IIRC) in your setup.

Also, the user can always alter that value using the Add-In Manager (Startup
and Command-Line checkbox columns).

Signature

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

> Thank you Carlos,
>
[quoted text clipped - 9 lines]
> Thanx,
> Neha
NS - 28 Oct 2005 17:51 GMT
Hi Carlos,

I set the value of loadBehavior to 3 in the registry, but still it doesn't
show my menu and toolbar on starting visual studio.  However in the add-in
manager it shows my add-in as checked. I have to uncheck it, close add-in
manager and then reopen and check the add-in in the add-in manager, then only
it shows the toolbar and menu. As u suggested I have created temporary
toolbar and menu. I am creating the registry for this add-in in HKLM. Please
suggest me what am I doing wrong.

Thanx,
Neha

> When you register your assembly as a VS.NET add-in, there is a registry
> entry named LoadBehavior that sets if the add-in must be loaded
[quoted text clipped - 17 lines]
> > Thanx,
> > Neha
Carlos J. Quintero [VB MVP] - 31 Oct 2005 10:21 GMT
Set a breakpoint  in the OnConnection method and debug to know why your
add-in does not create the menus or if you can´t debug, put some
MessageBoxes to know what's going on in that method.

Signature

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

> Hi Carlos,
>
[quoted text clipped - 10 lines]
> Thanx,
> Neha

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.