Freigeben über


Gewusst wie: Aktualisieren von Visual Studio 2005-Add-Ins auf Visual Studio 2008

Aktualisiert: November 2007

You can migrate your Visual Studio 2005 add-ins to make them compatible with the Visual Studio 2008 environment. Migrated add-ins gain access to updated and new features.

Hinweis:

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. These procedures were developed with the General Development Settings active. To change your settings, choose Import and ExportSettings on the Tools menu. For more information, see Visual Studio-Einstellungen.

To migrate an unmanaged C++ add-in to Visual Studio 2008

  1. On a computer that has Visual Studio 2008 installed, export the registry key at HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\AddIns\<youraddinname>.<yourclassname>.

  2. Open the registry key and change the path to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\AddIns\<youraddinname>.<yourclassname>.

  3. Copy the registry key to a computer that has Visual Studio 2008 installed and double-click it to add the entry to the registry.

  4. Copy the entire solution folder to a computer that has Visual Studio 2008 installed.

  5. Start Visual Studio 2008 and open the solution.

    The Visual Studio-Konvertierungs-Assistent starts.

  6. Use the Visual Studio Conversion Wizard to convert the project to the Visual Studio 2008 format.

  7. If you have a deployment project, open it and then select the Registry Editor in Visual Studio.

    The registry icon is on a toolbar at the top of Solution Explorer. This opens the associated registry key for the setup project.

  8. Open the registry key entry at HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Addins\<youraddinname>.<yourclassname> and rename it to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Addins\<youraddinname>.<yourclassname>.

    This updates the deployment project.

  9. Confirm that there are no references to Microsoft.Office.Core.Commandbars in Office.dll.

    Search the project for "Office" and delete references. Add a reference to the Microsoft.VisualStudio.CommandBars assembly if CommandBars are used.

  10. Confirm that version number references to DTE are for the 9.0 version.

    Search through project documents for 8.0 and update version information to 9.0.

  11. Add a reference to the EnvDTE90 assembly.

  12. Change references from the DTE object to the DTE2object.

    This provides access to new functionality.

  13. Review the code to confirm it is updated.

  14. Rebuild the solution and run the add-in.

To migrate a managed add-in to Visual Studio 2008

  1. Copy the entire solution folder that contains the managed add-in to the computer that has Visual Studio 2008 installed.

  2. Start Visual Studio 2008 and open the solution.

    The Visual Studio Conversion Wizard starts. Use this to convert the project to the Visual Studio 2008 format.

  3. If the add-in contains references to Office.dll and contains the using Microsoft.Office.Core statement, delete both the reference and the statement. Add a reference to the Microsoft.VisualStudio.CommandBars assembly if the add-in uses command bars.

  4. Confirm that the path to the working directory is correct by opening the Project Properties Page and selecting the Debug Page. Update the path to the appropriate directory for Visual Studio 2008. The path may be similar to \Program Files\Microsoft Visual Studio 9\Common7\IDE\.

  5. Confirm that the Start Action on the Debug Page has the correct path for the Start external program option.

    This creates an instance of Visual Studio for running the debugger against the add-in. The path may be similar to \Program Files\Microsoft Visual Studio 9\Common7\IDE\devenv.exe.

  6. Add a reference to the EnvDTE90 assembly.

  7. Change references from the DTE object to the DTE2 object.

    This provides access to new functionality.

  8. Review the code to confirm it is updated.

  9. Rebuild the solution and run the add-in in debug mode.