I am using the following code to add a menu to visual studio here is the complete function (see below)

it works fine; the problem is when i take it to a test station (I mean when I move the dll), when I first open visual studio it shows the menu, then when I close visual studio and open it back, the menu does not show up

if I change the code when I put the menu under the tools menu, there is not problem

is there a way to fix that. I know by default visual studio add add in command to the tools menu, there must be a way to fix that

PHP Code:
public void OnConnection(object applicationext_ConnectMode connectModeobject addInInstref Array custom)
        {
            
_applicationObject = (DTE2)application;
            
_addInInstance = (AddIn)addInInst;
            if(
connectMode == ext_ConnectMode.ext_cm_UISetup)
            {
                
object []contextGUIDS = new object[] { };
                
Commands2 commands = (Commands2)_applicationObject.Commands;
                
string testMenuName "Test";
 
                
//Place the command on the tools menu.
                //Find the MenuBar command bar, which is the top-level command bar holding all the main menu items:
                
CommandBar menuBarCommandBar = ((CommandBars)_applicationObject.CommandBars)["MenuBar"];
 
                
//Find the Test command bar on the MenuBar command bar. This is the "before" parameter to add new command bar:
                
CommandBarControl testControl menuBarCommandBar.Controls[testMenuName];                                
 
                
//This try/catch block can be duplicated if you wish to add multiple commands to be handled by your Add-in,
                //  just make sure you also update the QueryStatus/Exec method to include the new command names.
                
try
                {
                    
//Create new MyAddin8 command bar
                    
CommandBarControl myControl = (CommandBarControl)menuBarCommandBar.FindControl(MsoControlType.msoControlPopupSystem.Type.Missing"MyAddin8"truetrue);
                    if (
myControl == null)
                    {
                        
//Create new MyAddin8 command bar
                        
myControl menuBarCommandBar.Controls.Add(TypeMsoControlType.msoControlPopupId1234567890BeforetestControl.Index);
                        
myControl.Caption "MyAddin8";
                    }
                    
CommandBarPopup myControlPopup = (CommandBarPopup)myControl;
 

                    
//Add a command to the Commands collection:
                    
Command command commands.AddNamedCommand2(_addInInstance"MyCommand1""MyCommand1""Executes the command for MyCommand1"true59ref contextGUIDS, (int)vsCommandStatus.vsCommandStatusSupported+(int)vsCommandStatus.vsCommandStatusEnabled, (int)vsCommandStyle.vsCommandStylePictAndTextvsCommandControlType.vsCommandControlTypeButton);
                    
//Add a control for the command to the tools menu:
                    
if((command != null) && (myControl != null))
                    {
                        
command.AddControl(myControlPopup.CommandBar);
                    }
 

                    
//Add another command to the Commands collection:
                    
Command command2 commands.AddNamedCommand2(_addInInstance"MyCommand2""MyCommand2""Executes the command for MyCommand2"true59ref contextGUIDS, (int)vsCommandStatus.vsCommandStatusSupported + (int)vsCommandStatus.vsCommandStatusEnabled, (int)vsCommandStyle.vsCommandStylePictAndTextvsCommandControlType.vsCommandControlTypeButton);
                    
//Add a control for the command to the tools menu:
                    
if ((command2 != null) && (myControl != null))
                    {
                        
command2.AddControl(myControlPopup.CommandBar2);
                    }
                }
                catch(
System.ArgumentException)
                {
                    
//If we are here, then the exception is probably because a command with that name
                    //  already exists. If so there is no need to recreate the command and we can 
                    //  safely ignore the exception.
                
}
            }
        }