What’s New for Automation in Visual Studio 2005





Visual Studio 2005 features a number of targeted, programmable object models. By using these models, you can access the underlying components and events inside the Visual Studio integrated development environment (IDE) and its projects. Each model contains types and members that represent solutions, projects, tool windows, code editors, debuggers, code objects, documents, events, and more. Consequently, you can extend the functionality of the IDE, automate repetitive tasks, and integrate other applications into the IDE. The object models can be accessed through any of four methods: macros, add-ins, wizards, and the Visual Studio Industry Partner (VSIP) program.


The Visual Studio 2005 automation models will have the following changes and new features:




  • XML Add-In Registration   Rather than registering components in the Windows registry, you now use XML files to define the registration settings for add-ins. Simply copy the XML registration file to the appropriate folders for Visual Studio to find and load your add-in. The files contain comments that describe the various tags, which help you easily locate and edit their settings. When you create add-ins by using the Add-In Manager, this file is created automatically.

  • DTE2.Toolwindows   The new EnvDTE80.ToolWindows object is also available as the EnvDTE80.DTE2.ToolWindows property. It improves the discoverability and usability of tool windows in the object model by providing easier access to the tool windows in the IDE in their native types. Visual Studio tool windows may be accessed through member properties. Other tool windows may be located with the new GetToolWindow function.

  • DTE.Toolwindows.CreateToolWindow2   The new CreateToolWindow2 method makes it easier to create your own custom tool windows that host user controls. A shim control is no longer required.

  • Managed code add-ins   The Add-In Wizard now supports C++ on the .NET Framework, as well as getting resources from managed satellite DLLs.

  • Managed tools options   There are new options on the Tools Options menu for managed code.

  • Add-In Wizard and Visual J#   The Add-In Wizard now supports creating add-ins by using Visual J#.

  • KeyPress events   The Editor automation model offers a new EnvDTE80.TextDocumentKeyPressEvents object which has two events to handle keystroke entries in the Editor: EnvDTE80.TextDocumentKeyPressEventsClass.BeforeKeyPress and EnvDTE80.TextDocumentKeyPressEventsClass.AfterKeyPress.

  • InsertNewLine method   The Editor automation model offers a new EnvDTE80.EditPoint2.InsertNewLine(System.Int32) method to insert lines into documents in the editor.

  • Solution Folders   Solutions can now contain Solution Folders in addition to projects. Solution Folders are project containers that allow you to better organize large applications.

  • Task List default navigation   You can now go directly to lines in code by double-clicking items in the Task List (Visual Studio).

  • Synchronous Find   The EnvDTE80.DTE2.Find object offers a new property, EnvDTE80.Find2.WaitForFindToComplete, which enables you to specify whether a search is performed synchronously or asynchronously.

  • Tool window command bar support   Some tool windows include a toolbar for accessing their functionality. Although these toolbars are not available from the CommandBars collection on the DTE object, they are available on the Window object of the tool window.

  • Enhanced AddNamedCommand   The new EnvDTE80.vsCommandControlType parameter in AddNamedCommand2 now enables you to specify the style of a button, such as text only, icon only, or text and icon. You can also create additional types of controls to place in the toolbars and menus, such as listbox controls, editbox controls, and drop-down menu controls.

  • Localization   Sample macros are now localized, and the Add-In Wizard generates add-ins with the appropriate language. For example, if you are running Japanese Visual Studio, add-ins are created by using the Japanese templates (if they are available).

  • Add-In and Macro Security   You can now specify whether macros are allowed to run, whether add-ins are allowed to load, and where Visual Studio searches for .Addin configuration files.


  • New Command Bar Assembly   Command bar functionality has been moved to a new Visual Studio assembly, Microsoft.VisualStudio.CommandBars, eliminating dependence on the Microsoft Office library (Mso.dll).

  • Code Model Consistency   All the programming languages in Visual Studio use more of the core code model than previous versions, making for a more consistent programming experience.

  • Core Model Additions   A new assembly named EnvDTE80 contains a number of new automation members.

  • Language Model Additions   A new assembly named VSLangProj80 contains a number of new automation members for Visual Basic, Visual C#, and Visual J#.

  • More Example Code   More Help topics for the various automation object models now feature example code. Many of them have both Visual Basic and Visual C# code.

Comments are appreciated. How can we help you?


Comments (10)

  1. michael he says:

    Then how can we acces the CommandBars object in the native code? Thanks.

  2. Christian says:

    I try to get into the API for VS. But they are so poorly documented, it’s like digging in the black.

    Could you please provide the same type of documentation the .NET SDK does? That would be wonderful…

    I have no money (right now) to go to some expensive courses at Microsoft to learn to work with your technologies, but I have time to learn them. A better help would be very appreciated.

  3. Kemp Brown [MSFT] says:

    Michael, we’re in the middle of revising the topics on CommandBars, but I’ll post the relevent info here when we’re done with it. (Which should be in the week or two.)

    Christian, I’m sorry to hear you’re having problems finding the documentation for VS automation. It does exist, however, and you can find the main automation topic in VS 2005 at:

    ms-help://MS.VSCC.v80/MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_extcore/html/f71a2253-3e68-4e5e-9a18-edbba816caf6.htm

    Just copy and paste this link into the URL box in VS Help and it will display the topic. The first link, "Extending the Visual Studio Environment," takes you to the main topics page for the "how-to" topics for automation. There are about 100 how-to topics currently, so chances are good that you’ll find what you’re looking for. If you’re looking for more sequential, in-depth information, however, I recommend checking out the book, "Inside Microsoft Visual Studio .NET." It’s not as expensive as a course and it’s very informative.

    The link in this topic, "Automation and Extensibility Reference" takes you to the master page that points to the reference topics for all of the available automation models.

    Before VS 2005 releases, we will be adding many more keywords to the index and cross links between the topics to make it even easier to find what you’re looking for. For now, though, we are concentrating mainly on getting solid content added to the topics. So you will soon find it easier to locate topics. (BTW, you can press F1 on any keyword in the editor to bring up its reference topic.)