Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
 CommandBar Changes for Visual Studi...
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual Studio Automation and Extensibility
CommandBar Changes for Visual Studio 2005

Updated: November 2007

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:

    Visual Basic
    Includes Microsoft.Office.Core
    using Microsoft.Office.Core;
    

    to

    Visual Basic
    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.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker