Share via


CommandBar Changes for Visual Studio 2005

In Visual Studio .NET 2002 and Visual Studio .NET 2003, command bars were referenced in the Microsoft.Office.Core component. In Visual Studio 2005, this command bar functionality is available in a component referenced as Microsoft.VisualStudio.CommandBars.dll. In addition to offering all of the commandbar functionality offered by Microsoft.Office.Core, the new Microsoft.VisualStudio.CommandBars assembly features updates to some methods.

These updates require some minor changes to existing automation code in Visual Studio 2005. Note that changes are necessary only if you recompile your Add-in code or run a macro that uses the old types.

  • Remove the references to Microsoft.Office.Core and the older version of EnvDTE and replace them with references to the 8.0 version of EnvDTE and the command bar assembly, Microsoft.VisualStudio.CommandBars.

  • Update the type resolution code. For example change:

    Includes Microsoft.Office.Core
    
    using Microsoft.Office.Core;
    

    to

    Microsoft.VisualStudio.CommandBars
    
    using Microsoft.VisualStudio.CommandBars;
    
  • Update any code that calls DTE.CommandBars, Command.AddControl, Commands.RemoveCommandBar, or Commands.AddCommandBar. This is necessary because rather than taking or returning a type in the Microsoft.Office.Core namespace, those members now take or return an IDispatch or System.Object.

See Also

Concepts

Displaying Add-ins on Toolbars and Menus